home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / FAQSYS18.ZIP / FAQS.DAT / 3DFAQ.TXT < prev    next >
Mailbox/MIME Entity  |  1996-01-04  |  16.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Mailbox/MIME Entity (archive/mbox).

You can browse this item here: 3DFAQ.TXT

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Swift 3D 3D Graphic (poly/swift3D3DGraphic) ext Unsupported
1% dexvert Boost Text serialization (other/boostTextSerialization) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file Mailbox text, 1st line "From pat@nick.csh.rit.edu (Pat Fleckenstein (HoseNode))" default
99% file C source text default
98% file C source, ASCII text, with CRLF line terminators default
100% TrID E-Mail message (Var. 2) default
100% perlTextCheck Likely Text (Perl) default
100% siegfried x-fmt/111 Plain Text File default
100% gt2 Textdatei (DOS) default
100% detectItEasy Format: plain text[CRLF] default (weak)
100% xdgMime application/mbox default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 70 61 74 | 40 6e 69 63 6b 2e 63 73 |From pat|@nick.cs|
|00000010| 68 2e 72 69 74 2e 65 64 | 75 20 28 50 61 74 20 46 |h.rit.ed|u (Pat F|
|00000020| 6c 65 63 6b 65 6e 73 74 | 65 69 6e 20 28 48 6f 73 |leckenst|ein (Hos|
|00000030| 65 4e 6f 64 65 29 29 0d | 0a 4e 65 77 73 67 72 6f |eNode)).|.Newsgro|
|00000040| 75 70 73 3a 20 72 65 63 | 2e 67 61 6d 65 73 2e 70 |ups: rec|.games.p|
|00000050| 72 6f 67 72 61 6d 6d 65 | 72 0d 0a 53 75 62 6a 65 |rogramme|r..Subje|
|00000060| 63 74 3a 20 46 41 51 3a | 20 33 2d 44 20 49 6e 66 |ct: FAQ:| 3-D Inf|
|00000070| 6f 72 6d 61 74 69 6f 6e | 20 66 6f 72 20 74 68 65 |ormation| for the|
|00000080| 20 50 72 6f 67 72 61 6d | 6d 65 72 0d 0a 44 61 74 | Program|mer..Dat|
|00000090| 65 3a 20 54 68 75 2c 20 | 33 20 4d 61 72 20 31 39 |e: Thu, |3 Mar 19|
|000000a0| 39 34 20 31 38 3a 32 36 | 3a 31 38 20 47 4d 54 0d |94 18:26|:18 GMT.|
|000000b0| 0a 0d 0a 0d 0a 20 20 20 | 20 20 20 20 20 20 20 5f |..... | _|
|000000c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000000d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000000e0| 5f 5f 5f 5f 5f 0d 0a 20 | 20 20 20 20 20 20 20 20 |_____.. | |
|000000f0| 20 7c 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | | |
|00000100| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000110| 20 20 20 20 20 20 7c 5c | 0d 0a 20 20 20 20 20 20 | |\|.. |
|00000120| 20 20 20 20 7c 20 20 40 | 40 40 40 40 20 20 20 20 | | @|@@@@ |
|00000130| 40 40 40 40 20 20 20 20 | 40 40 40 40 20 20 40 40 |@@@@ |@@@@ @@|
|00000140| 20 20 20 40 40 40 20 20 | 20 7c 2a 7c 0d 0a 20 20 | @@@ | |*|.. |
|00000150| 20 20 20 20 20 20 20 20 | 7c 20 20 20 20 20 40 20 | || @ |
|00000160| 20 20 20 20 40 40 20 20 | 40 20 20 20 40 40 20 20 | @@ |@ @@ |
|00000170| 20 40 40 20 40 20 40 40 | 20 20 40 20 20 7c 2a 7c | @@ @ @@| @ |*||
|00000180| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 7c 20 20 20 |.. | | |
|00000190| 20 40 40 20 20 40 40 20 | 40 40 20 20 40 20 20 20 | @@ @@ |@@ @ |
|000001a0| 40 40 40 40 20 40 40 40 | 40 20 40 40 20 20 40 20 |@@@@ @@@|@ @@ @ |
|000001b0| 20 7c 2a 7c 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | |*|.. | |
|000001c0| 7c 20 20 40 40 20 20 40 | 20 20 20 20 40 40 20 20 || @@ @| @@ |
|000001d0| 40 20 20 20 40 40 20 20 | 20 40 40 20 40 20 40 40 |@ @@ | @@ @ @@|
|000001e0| 20 40 40 20 20 7c 2a 7c | 0d 0a 20 20 20 20 20 20 | @@ |*||.. |
|000001f0| 20 20 20 20 7c 20 20 20 | 40 40 40 20 20 20 20 20 | | |@@@ |
|00000200| 40 40 40 40 20 20 20 20 | 40 40 20 20 20 40 40 20 |@@@@ |@@ @@ |
|00000210| 40 20 20 40 40 40 40 20 | 20 7c 2a 7c 0d 0a 20 20 |@ @@@@ | |*|.. |
|00000220| 20 20 20 20 20 20 20 20 | 7c 5f 5f 5f 5f 5f 5f 5f | ||_______|
|00000230| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000240| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 7c 2a 7c |________|_____|*||
|00000250| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 5c 2a 2a |.. | \**|
|00000260| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000270| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000280| 2a 5c 2a 7c 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |*\*|.. | |
|00000290| 20 20 5c 2a 62 65 74 74 | 65 72 2a 67 72 61 70 68 | \*bett|er*graph|
|000002a0| 69 63 73 2a 6c 61 74 65 | 72 2a 49 2a 70 72 6f 6d |ics*late|r*I*prom|
|000002b0| 69 73 65 2a 2a 2a 5c 7c | 0d 0a 20 20 20 20 20 20 |ise***\||.. |
|000002c0| 20 20 20 20 20 20 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d | -|--------|
|000002d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000002e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 0d 0a 0d 0a 0d |--------|---.....|
|000002f0| 0a 43 6f 6e 74 65 6e 74 | 73 3a 0d 0a 0d 0a 31 29 |.Content|s:....1)|
|00000300| 20 47 65 6e 65 72 61 6c | 20 72 65 66 65 72 65 6e | General| referen|
|00000310| 63 65 73 20 66 6f 72 20 | 33 2d 64 20 67 72 61 70 |ces for |3-d grap|
|00000320| 68 69 63 73 20 71 75 65 | 73 74 69 6f 6e 73 2e 0d |hics que|stions..|
|00000330| 0a 0d 0a 32 29 20 48 6f | 77 20 64 6f 20 49 20 64 |...2) Ho|w do I d|
|00000340| 65 66 69 6e 65 20 61 6e | 20 6f 62 6a 65 63 74 3f |efine an| object?|
|00000350| 0d 0a 0d 0a 33 29 20 48 | 6f 77 20 64 6f 20 49 20 |....3) H|ow do I |
|00000360| 64 65 66 69 6e 65 20 73 | 70 61 63 65 3f 0d 0a 0d |define s|pace?...|
|00000370| 0a 34 29 20 48 6f 77 20 | 64 6f 20 49 20 64 65 66 |.4) How |do I def|
|00000380| 69 6e 65 20 70 6f 73 69 | 74 69 6f 6e 3f 0d 0a 0d |ine posi|tion?...|
|00000390| 0a 35 29 20 48 6f 77 20 | 64 6f 20 49 20 64 65 66 |.5) How |do I def|
|000003a0| 69 6e 65 20 6f 72 69 65 | 6e 74 61 74 69 6f 6e 3f |ine orie|ntation?|
|000003b0| 0d 0a 0d 0a 36 29 20 48 | 6f 77 20 64 6f 20 49 20 |....6) H|ow do I |
|000003c0| 64 65 66 69 6e 65 20 61 | 20 76 65 6c 6f 63 69 74 |define a| velocit|
|000003d0| 79 3f 0d 0a 0d 0a 37 29 | 20 44 72 61 77 69 6e 67 |y?....7)| Drawing|
|000003e0| 20 74 68 72 65 65 2d 64 | 69 6d 65 6e 73 69 6f 6e | three-d|imension|
|000003f0| 61 6c 20 6f 62 6a 65 63 | 74 73 20 6f 6e 20 61 20 |al objec|ts on a |
|00000400| 74 77 6f 2d 64 69 6d 65 | 6e 73 69 6f 6e 61 6c 20 |two-dime|nsional |
|00000410| 73 63 72 65 65 6e 2e 0d | 0a 0d 0a 38 29 20 56 65 |screen..|...8) Ve|
|00000420| 63 74 6f 72 20 4d 61 74 | 68 20 2d 20 44 6f 74 20 |ctor Mat|h - Dot |
|00000430| 50 72 6f 64 75 63 74 20 | 61 6e 64 20 43 72 6f 73 |Product |and Cros|
|00000440| 73 2d 50 72 6f 64 75 63 | 74 2e 0d 0a 0d 0a 39 29 |s-Produc|t.....9)|
|00000450| 20 4d 61 74 72 69 78 20 | 4d 61 74 68 0d 0a 0d 0a | Matrix |Math....|
|00000460| 31 30 29 20 43 6f 6c 6c | 69 73 69 6f 6e 73 2e 0d |10) Coll|isions..|
|00000470| 0a 0d 0a 31 31 29 20 50 | 65 72 73 70 65 63 74 69 |...11) P|erspecti|
|00000480| 76 65 2e 0d 0a 0d 0a 31 | 32 29 20 5a 2d 42 75 66 |ve.....1|2) Z-Buf|
|00000490| 66 65 72 69 6e 67 20 26 | 20 74 68 65 20 50 61 69 |fering &| the Pai|
|000004a0| 6e 74 65 72 73 20 41 6c | 67 6f 72 69 74 68 6d 2e |nters Al|gorithm.|
|000004b0| 0d 0a 0d 0a 31 33 29 20 | 53 68 61 64 69 6e 67 2e |....13) |Shading.|
|000004c0| 0d 0a 0d 0a 31 34 29 20 | 33 2d 73 70 61 63 65 20 |....14) |3-space |
|000004d0| 63 6c 69 70 70 69 6e 67 | 2e 0d 0a 0d 0a 31 35 29 |clipping|.....15)|
|000004e0| 20 33 2d 64 20 73 63 61 | 6e 6e 69 6e 67 2e 0d 0a | 3-d sca|nning...|
|000004f0| 0d 0a 31 36 29 20 50 75 | 62 6c 69 63 61 6c 6c 79 |..16) Pu|blically|
|00000500| 20 61 76 61 69 6c 61 62 | 6c 65 20 73 6f 75 72 63 | availab|le sourc|
|00000510| 65 2d 63 6f 64 65 2e 0d | 0a 0d 0a 31 37 29 20 42 |e-code..|...17) B|
|00000520| 6f 6f 6b 73 20 6f 6e 20 | 74 68 65 20 74 6f 70 69 |ooks on |the topi|
|00000530| 63 73 2e 0d 0a 0d 0a 31 | 38 29 20 4f 74 68 65 72 |cs.....1|8) Other|
|00000540| 20 66 6f 72 75 6d 73 2e | 0d 0a 0d 0a 0d 0a 4c 61 | forums.|......La|
|00000550| 73 74 20 75 70 64 61 74 | 65 3a 0d 0a 20 20 20 20 |st updat|e:.. |
|00000560| 20 32 31 44 65 63 39 33 | 0d 0a 0d 0a 57 68 61 74 | 21Dec93|....What|
|00000570| 27 73 20 6e 65 77 3f 0d | 0a 0d 0a 20 20 20 20 20 |'s new?.|... |
|00000580| 54 68 69 73 20 77 68 6f | 6c 65 20 62 61 6c 6c 20 |This who|le ball |
|00000590| 6f 66 20 77 61 78 2e 0d | 0a 0d 0a 31 29 20 47 65 |of wax..|...1) Ge|
|000005a0| 6e 65 72 61 6c 20 72 65 | 66 65 72 65 6e 63 65 73 |neral re|ferences|
|000005b0| 20 66 6f 72 20 33 2d 64 | 20 67 72 61 70 68 69 63 | for 3-d| graphic|
|000005c0| 73 20 71 75 65 73 74 69 | 6f 6e 73 2e 0d 0a 0d 0a |s questi|ons.....|
|000005d0| 20 20 20 20 20 57 65 6c | 6c 2c 20 74 68 69 73 20 | Wel|l, this |
|000005e0| 46 41 51 20 69 73 20 6a | 75 73 74 20 67 65 74 74 |FAQ is j|ust gett|
|000005f0| 69 6e 67 20 6f 66 66 20 | 74 68 65 20 67 72 6f 75 |ing off |the grou|
|00000600| 6e 64 2e 20 20 48 6f 70 | 65 66 75 6c 6c 79 20 69 |nd. Hop|efully i|
|00000610| 74 20 77 69 6c 6c 0d 0a | 74 6f 75 63 68 20 6f 6e |t will..|touch on|
|00000620| 20 6d 6f 73 74 20 6f 66 | 20 74 68 65 20 62 61 73 | most of| the bas|
|00000630| 65 73 20 79 6f 75 20 6e | 65 65 64 20 74 6f 20 67 |es you n|eed to g|
|00000640| 65 74 20 73 74 61 72 74 | 65 64 20 66 6f 72 20 6e |et start|ed for n|
|00000650| 6f 77 2c 20 61 6e 64 20 | 68 6f 70 65 2d 0d 0a 66 |ow, and |hope-..f|
|00000660| 75 6c 6c 79 20 69 74 20 | 77 69 6c 6c 20 65 78 70 |ully it |will exp|
|00000670| 61 6e 64 20 61 74 20 6c | 65 61 73 74 20 61 73 20 |and at l|east as |
|00000680| 66 61 73 74 20 61 73 20 | 79 6f 75 20 6e 65 65 64 |fast as |you need|
|00000690| 20 69 74 20 74 6f 6f 2e | 20 20 42 75 74 2e 2e 2e | it too.| But...|
|000006a0| 0d 0a 72 65 67 61 72 64 | 6c 65 73 73 2c 20 74 68 |..regard|less, th|
|000006b0| 69 6e 67 73 20 79 6f 75 | 27 6c 6c 20 77 61 6e 74 |ings you|'ll want|
|000006c0| 20 74 6f 20 6c 6f 63 61 | 74 65 20 66 6f 72 20 6d | to loca|te for m|
|000006d0| 6f 72 65 20 68 65 6c 70 | 20 61 72 65 20 4d 61 74 |ore help| are Mat|
|000006e0| 72 69 78 20 41 6c 67 65 | 2d 0d 0a 62 72 61 20 62 |rix Alge|-..bra b|
|000006f0| 6f 6f 6b 73 2c 20 50 68 | 79 73 69 63 73 20 62 6f |ooks, Ph|ysics bo|
|00000700| 6f 6b 73 20 74 61 6c 6b | 69 6e 67 20 61 62 6f 75 |oks talk|ing abou|
|00000710| 74 20 45 75 6c 65 72 69 | 61 6e 20 6d 6f 74 69 6f |t Euleri|an motio|
|00000720| 6e 2c 20 61 6e 64 20 73 | 6f 6d 65 20 62 6f 6f 6b |n, and s|ome book|
|00000730| 73 0d 0a 6f 6e 20 74 68 | 65 20 47 72 61 70 68 69 |s..on th|e Graphi|
|00000740| 63 73 20 48 61 72 64 77 | 61 72 65 20 79 6f 75 20 |cs Hardw|are you |
|00000750| 77 61 6e 74 20 74 6f 20 | 70 72 6f 67 72 61 6d 20 |want to |program |
|00000760| 66 6f 72 2e 20 20 54 68 | 65 20 63 6f 64 65 20 65 |for. Th|e code e|
|00000770| 78 61 6d 70 6c 65 73 0d | 0a 69 6e 63 6c 75 64 65 |xamples.|.include|
|00000780| 64 20 69 6e 20 74 68 69 | 73 20 46 41 51 20 77 69 |d in thi|s FAQ wi|
|00000790| 6c 6c 20 6d 6f 73 74 20 | 6c 69 6b 65 6c 79 20 62 |ll most |likely b|
|000007a0| 65 20 69 6e 20 43 20 77 | 69 74 68 20 70 73 65 75 |e in C w|ith pseu|
|000007b0| 64 6f 2d 63 6f 64 65 20 | 69 6e 20 63 6f 6d 2d 0d |do-code |in com-.|
|000007c0| 0a 6d 65 6e 74 73 2e 0d | 0a 0d 0a 20 20 20 20 20 |.ments..|... |
|000007d0| 42 75 74 2c 20 79 6f 75 | 27 6c 6c 20 61 6c 73 6f |But, you|'ll also|
|000007e0| 20 77 61 6e 74 20 74 6f | 20 64 65 66 69 6e 74 65 | want to| definte|
|000007f0| 6c 79 20 63 68 65 63 6b | 20 6f 75 74 20 74 68 65 |ly check| out the|
|00000800| 20 46 41 51 20 66 6f 72 | 0d 0a 63 6f 6d 70 2e 67 | FAQ for|..comp.g|
|00000810| 72 61 70 68 69 63 73 2e | 20 20 54 68 61 74 20 46 |raphics.| That F|
|00000820| 41 51 20 74 6f 75 63 68 | 65 73 20 6d 61 69 6e 6c |AQ touch|es mainl|
|00000830| 79 20 6f 6e 20 32 2d 44 | 20 6e 65 65 64 73 2c 20 |y on 2-D| needs, |
|00000840| 62 75 74 20 73 6f 6d 65 | 20 33 2d 44 0d 0a 61 73 |but some| 3-D..as|
|00000850| 70 65 63 74 73 20 61 72 | 65 20 72 65 76 69 65 77 |pects ar|e review|
|00000860| 65 64 20 74 68 65 72 65 | 2c 20 74 6f 6f 2e 0d 0a |ed there|, too...|
|00000870| 0d 0a 32 29 20 48 6f 77 | 20 64 6f 20 49 20 64 65 |..2) How| do I de|
|00000880| 66 69 6e 65 20 61 6e 20 | 6f 62 6a 65 63 74 3f 0d |fine an |object?.|
|00000890| 0a 0d 0a 20 20 20 20 20 | 54 68 65 72 65 20 61 72 |... |There ar|
|000008a0| 65 20 6c 6f 74 73 20 6f | 66 20 77 61 79 73 20 74 |e lots o|f ways t|
|000008b0| 6f 20 64 65 66 69 6e 65 | 20 6f 62 6a 65 63 74 73 |o define| objects|
|000008c0| 2e 20 20 4f 6e 65 20 6f | 66 20 74 68 65 20 6d 6f |. One o|f the mo|
|000008d0| 73 74 20 63 6f 6d 6d 6f | 6e 6c 79 0d 0a 75 73 65 |st commo|nly..use|
|000008e0| 64 20 69 73 20 74 68 65 | 20 4f 46 46 20 28 4f 62 |d is the| OFF (Ob|
|000008f0| 6a 65 63 74 20 46 69 6c | 65 20 46 6f 72 6d 61 74 |ject Fil|e Format|
|00000900| 29 2e 20 20 54 68 65 20 | 4f 46 46 20 74 6f 6f 6c |). The |OFF tool|
|00000910| 6b 69 74 20 61 6e 64 20 | 61 20 6c 69 62 72 61 72 |kit and |a librar|
|00000920| 79 20 6f 66 0d 0a 6f 62 | 6a 65 63 74 73 20 61 72 |y of..ob|jects ar|
|00000930| 65 20 61 76 61 69 6c 61 | 62 6c 65 20 76 69 61 20 |e availa|ble via |
|00000940| 61 6e 6f 6e 79 6d 6f 75 | 73 20 66 74 70 20 66 72 |anonymou|s ftp fr|
|00000950| 6f 6d 20 67 61 74 65 6b | 65 65 70 65 72 2e 64 65 |om gatek|eeper.de|
|00000960| 63 2e 63 6f 6d 20 2d 2d | 20 58 58 58 0d 0a 3f 3f |c.com --| XXX..??|
|00000970| 3f 2e 20 20 54 68 65 20 | 66 6f 72 6d 61 74 20 70 |?. The |format p|
|00000980| 72 6f 76 69 64 65 73 20 | 65 61 73 79 20 6d 65 74 |rovides |easy met|
|00000990| 68 6f 64 73 20 66 6f 72 | 20 65 78 74 65 6e 73 69 |hods for| extensi|
|000009a0| 6f 6e 73 20 61 6e 64 20 | 61 20 62 61 73 65 20 73 |ons and |a base s|
|000009b0| 65 74 20 6f 66 0d 0a 74 | 68 69 6e 67 73 20 79 6f |et of..t|hings yo|
|000009c0| 75 20 63 61 6e 20 65 78 | 70 65 63 74 20 66 6f 72 |u can ex|pect for|
|000009d0| 20 65 61 63 68 20 6f 62 | 6a 65 63 74 2e 20 20 54 | each ob|ject. T|
|000009e0| 68 65 20 74 6f 6f 6c 6b | 69 74 20 69 73 20 61 20 |he toolk|it is a |
|000009f0| 62 69 74 20 62 75 6c 6b | 79 2c 20 62 75 74 0d 0a |bit bulk|y, but..|
|00000a00| 74 68 65 20 66 69 6c 65 | 20 66 6f 72 6d 61 74 20 |the file| format |
|00000a10| 28 69 6e 20 61 73 63 69 | 69 29 20 69 73 20 65 61 |(in asci|i) is ea|
|00000a20| 73 79 20 65 6e 6f 75 67 | 68 20 74 6f 20 70 61 72 |sy enoug|h to par|
|00000a30| 73 65 20 62 79 20 68 61 | 6e 64 2e 0d 0a 0d 0a 20 |se by ha|nd..... |
|00000a40| 20 20 20 20 54 68 65 20 | 4f 46 46 2e 61 6f 66 66 | The |OFF.aoff|
|00000a50| 20 66 69 6c 65 20 63 6f | 6e 74 61 69 6e 73 20 69 | file co|ntains i|
|00000a60| 6e 66 6f 72 6d 61 74 69 | 6f 6e 20 61 62 6f 75 74 |nformati|on about|
|00000a70| 20 74 68 65 20 6f 62 6a | 65 63 74 2e 20 20 54 68 | the obj|ect. Th|
|00000a80| 65 20 6d 6f 73 74 0d 0a | 69 6d 70 6f 72 74 61 6e |e most..|importan|
|00000a90| 74 20 6f 6e 65 20 74 68 | 65 72 65 20 69 73 20 74 |t one th|ere is t|
|00000aa0| 68 65 20 6c 6f 63 61 74 | 69 6f 6e 20 6f 66 20 74 |he locat|ion of t|
|00000ab0| 68 65 20 73 75 72 66 61 | 63 65 20 73 70 65 63 69 |he surfa|ce speci|
|00000ac0| 66 69 63 61 74 69 6f 6e | 20 66 69 6c 65 0d 0a 28 |fication| file..(|
|00000ad0| 75 73 75 61 6c 6c 79 20 | 6f 62 6a 65 63 74 20 6e |usually |object n|
|00000ae0| 61 6d 65 2e 67 65 6f 6d | 29 2e 20 20 54 68 69 73 |ame.geom|). This|
|00000af0| 20 66 69 6c 65 20 61 6c | 73 6f 20 63 6f 6e 74 61 | file al|so conta|
|00000b00| 69 6e 73 20 6f 74 68 65 | 72 20 61 74 74 72 69 62 |ins othe|r attrib|
|00000b10| 75 74 65 73 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |utes.. | |
|00000b20| 20 20 20 20 20 2d 0d 0a | 61 6e 64 20 66 69 6c 65 | -..|and file|
|00000b30| 20 6e 61 6d 65 73 20 72 | 65 6c 65 76 61 6e 74 20 | names r|elevant |
|00000b40| 74 6f 20 74 68 69 73 20 | 6f 62 6a 65 63 74 2e 0d |to this |object..|
|00000b50| 0a 0d 0a 20 20 20 20 20 | 54 68 65 20 4f 46 46 20 |... |The OFF |
|00000b60| 73 75 72 66 61 63 65 20 | 73 70 65 63 69 66 69 63 |surface |specific|
|00000b70| 61 74 69 6f 6e 20 62 65 | 67 69 6e 73 20 77 69 74 |ation be|gins wit|
|00000b80| 68 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |h the nu|mber of |
|00000b90| 70 6f 69 6e 74 73 2c 20 | 74 68 65 0d 0a 6e 75 6d |points, |the..num|
|00000ba0| 62 65 72 20 6f 66 20 70 | 6f 6c 79 67 6f 6e 73 20 |ber of p|olygons |
|00000bb0| 61 6e 64 20 74 68 65 20 | 6e 75 6d 62 65 72 20 6f |and the |number o|
|00000bc0| 66 20 73 65 67 6d 65 6e | 74 73 2e 0d 0a 0d 0a 20 |f segmen|ts..... |
|00000bd0| 20 20 20 20 20 20 20 6e | 70 74 73 20 6e 70 6c 79 | n|pts nply|
|00000be0| 73 20 6e 73 65 67 73 0d | 0a 0d 0a 54 68 69 73 20 |s nsegs.|...This |
|00000bf0| 6c 69 6e 65 20 69 73 20 | 66 6f 6c 6c 6f 77 65 64 |line is |followed|
|00000c00| 20 62 79 20 74 68 65 20 | 66 6c 6f 61 74 69 6e 67 | by the |floating|
|00000c10| 20 70 6f 69 6e 74 20 63 | 6f 6f 72 64 69 6e 61 74 | point c|oordinat|
|00000c20| 65 73 20 66 6f 72 20 74 | 68 65 20 70 6f 69 6e 74 |es for t|he point|
|00000c30| 73 0d 0a 74 68 61 74 20 | 6d 61 6b 65 20 75 70 20 |s..that |make up |
|00000c40| 74 68 65 20 6f 62 6a 65 | 63 74 2e 0d 0a 0d 0a 20 |the obje|ct..... |
|00000c50| 20 20 20 20 20 20 20 78 | 31 20 79 31 20 7a 31 0d | x|1 y1 z1.|
|00000c60| 0a 20 20 20 20 20 20 20 | 20 78 32 20 79 32 20 7a |. | x2 y2 z|
|00000c70| 32 0d 0a 20 20 20 20 20 | 20 20 20 78 33 20 79 33 |2.. | x3 y3|
|00000c80| 20 7a 33 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 | z3.. | |
|00000c90| 2e 0d 0a 20 20 20 20 20 | 20 20 20 78 28 6e 70 74 |... | x(npt|
|00000ca0| 73 29 20 79 28 6e 70 74 | 73 29 20 7a 28 6e 70 74 |s) y(npt|s) z(npt|
|00000cb0| 73 29 0d 0a 0d 0a 54 68 | 65 6e 2c 20 69 74 20 67 |s)....Th|en, it g|
|00000cc0| 65 74 73 20 61 20 62 69 | 74 20 6d 6f 72 65 20 63 |ets a bi|t more c|
|00000cd0| 6f 6d 70 6c 69 63 61 74 | 65 64 2e 20 20 54 68 65 |omplicat|ed. The|
|00000ce0| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 6c 69 6e 65 73 | followi|ng lines|
|00000cf0| 20 62 65 67 69 6e 20 77 | 69 74 68 20 61 0d 0a 6e | begin w|ith a..n|
|00000d00| 75 6d 62 65 72 20 74 6f | 20 69 6e 64 69 63 61 74 |umber to| indicat|
|00000d10| 65 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |e the nu|mber of |
|00000d20| 76 65 72 74 69 63 65 73 | 20 69 6e 20 74 68 69 73 |vertices| in this|
|00000d30| 20 70 6f 6c 79 67 6f 6e | 2e 20 20 54 68 61 74 20 | polygon|. That |
|00000d40| 6e 75 6d 62 65 72 0d 0a | 69 73 20 66 6f 6c 6c 6f |number..|is follo|
|00000d50| 77 65 64 20 62 79 20 74 | 68 61 74 20 6d 61 6e 79 |wed by t|hat many|
|00000d60| 20 6e 75 6d 62 65 72 73 | 2c 20 6f 6e 65 20 66 6f | numbers|, one fo|
|00000d70| 72 20 65 61 63 68 20 76 | 65 72 74 69 63 65 2e 20 |r each v|ertice. |
|00000d80| 20 54 68 65 73 65 20 61 | 72 65 20 67 69 76 65 6e | These a|re given|
|00000d90| 0d 0a 69 6e 20 61 6e 20 | 6f 72 64 65 72 20 73 70 |..in an |order sp|
|00000da0| 65 63 69 66 69 65 64 20 | 69 6e 20 74 68 65 20 2e |ecified |in the .|
|00000db0| 61 6f 66 66 20 28 75 73 | 75 61 6c 6c 79 20 63 6f |aoff (us|ually co|
|00000dc0| 6e 74 65 72 2d 63 6c 6f | 63 6b 77 69 73 65 29 2e |nter-clo|ckwise).|
|00000dd0| 20 20 53 6f 2c 20 66 6f | 72 0d 0a 65 78 61 6d 70 | So, fo|r..examp|
|00000de0| 6c 65 2c 20 61 20 74 72 | 69 61 6e 67 6c 65 20 61 |le, a tr|iangle a|
|00000df0| 6e 64 20 61 20 70 65 6e | 74 61 67 6f 6e 20 77 68 |nd a pen|tagon wh|
|00000e00| 69 63 68 20 73 68 61 72 | 65 20 61 20 73 69 64 65 |ich shar|e a side|
|00000e10| 20 61 72 65 20 73 68 6f | 77 6e 20 62 65 6c 6f 77 | are sho|wn below|
|00000e20| 2e 0d 0a 0d 0a 20 20 20 | 20 20 20 20 20 33 20 20 |..... | 3 |
|00000e30| 20 20 20 20 20 31 20 33 | 20 34 0d 0a 20 20 20 20 | 1 3| 4.. |
|00000e40| 20 20 20 20 35 20 20 20 | 20 20 20 20 32 20 34 20 | 5 | 2 4 |
|00000e50| 33 20 36 20 37 0d 0a 0d | 0a 48 65 72 65 20 69 73 |3 6 7...|.Here is|
|00000e60| 20 73 6f 6d 65 20 71 75 | 69 63 6b 20 61 6e 64 20 | some qu|ick and |
|00000e70| 64 69 72 74 79 20 73 61 | 6d 70 6c 65 20 63 6f 64 |dirty sa|mple cod|
|00000e80| 65 20 74 6f 20 72 65 61 | 64 20 69 6e 20 74 68 65 |e to rea|d in the|
|00000e90| 20 2e 67 65 6f 6d 20 66 | 69 6c 65 3a 0d 0a 0d 0a | .geom f|ile:....|
|00000ea0| 73 74 72 75 63 74 20 70 | 6f 6c 79 67 6f 6e 20 7b |struct p|olygon {|
|00000eb0| 0d 0a 20 20 20 20 69 6e | 74 20 6e 76 65 72 74 3b |.. in|t nvert;|
|00000ec0| 20 20 20 20 20 20 20 20 | 20 20 2f 2a 20 4e 75 6d | | /* Num|
|00000ed0| 62 65 72 20 6f 66 20 76 | 65 72 74 69 63 65 73 20 |ber of v|ertices |
|00000ee0| 69 6e 20 74 68 69 73 20 | 70 6f 6c 79 67 6f 6e 20 |in this |polygon |
|00000ef0| 2a 2f 0d 0a 20 20 20 20 | 69 6e 74 20 2a 76 65 72 |*/.. |int *ver|
|00000f00| 74 73 3b 20 20 20 20 20 | 20 20 20 20 2f 2a 20 56 |ts; | /* V|
|00000f10| 65 72 74 69 63 65 73 20 | 69 6e 20 74 68 69 73 20 |ertices |in this |
|00000f20| 70 6f 6c 79 67 6f 6e 20 | 2a 2f 0d 0a 7d 3b 0d 0a |polygon |*/..};..|
|00000f30| 0d 0a 73 74 72 75 63 74 | 20 6f 62 6a 65 63 74 20 |..struct| object |
|00000f40| 7b 0d 0a 20 20 20 20 69 | 6e 74 20 6e 70 74 73 3b |{.. i|nt npts;|
|00000f50| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 54 68 | | /* Th|
|00000f60| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 70 6f 69 6e |e number| of poin|
|00000f70| 74 73 20 2a 2f 0d 0a 20 | 20 20 20 69 6e 74 20 6e |ts */.. | int n|
|00000f80| 70 6f 6c 79 73 3b 20 20 | 20 20 20 20 20 20 20 2f |polys; | /|
|00000f90| 2a 20 54 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |* The nu|mber of |
|00000fa0| 70 6f 6c 79 67 6f 6e 73 | 20 2a 2f 0d 0a 20 20 20 |polygons| */.. |
|00000fb0| 20 69 6e 74 20 6e 73 65 | 67 73 3b 20 20 20 20 20 | int nse|gs; |
|00000fc0| 20 20 20 20 20 2f 2a 20 | 54 68 65 20 6e 75 6d 62 | /* |The numb|
|00000fd0| 65 72 20 6f 66 20 73 65 | 67 6d 65 6e 74 73 20 2a |er of se|gments *|
|00000fe0| 2f 0d 0a 20 20 20 20 64 | 6f 75 62 6c 65 20 2a 70 |/.. d|ouble *p|
|00000ff0| 6f 69 6e 74 20 78 2c 2a | 70 6f 69 6e 74 20 79 2c |oint x,*|point y,|
|00001000| 2a 70 6f 69 6e 74 20 7a | 3b 0d 0a 20 20 20 20 20 |*point z|;.. |
|00001010| 20 20 20 20 20 20 20 20 | 20 20 20 20 2d 20 20 20 | | - |
|00001020| 20 20 20 20 20 2d 20 20 | 20 20 20 20 20 20 2d 0d | - | -.|
|00001030| 0a 20 20 20 20 73 74 72 | 75 63 74 20 70 6f 6c 79 |. str|uct poly|
|00001040| 67 6f 6e 20 2a 70 6f 6c | 79 73 3b 0d 0a 7d 3b 0d |gon *pol|ys;..};.|
|00001050| 0a 0d 0a 69 6e 74 0d 0a | 72 65 61 64 20 67 65 6f |...int..|read geo|
|00001060| 6d 20 66 69 6c 65 28 20 | 63 68 61 72 20 2a 67 65 |m file( |char *ge|
|00001070| 6f 6d 20 66 69 6c 65 2c | 20 73 74 72 75 63 74 20 |om file,| struct |
|00001080| 6f 62 6a 65 63 74 20 2a | 6f 62 6a 20 29 0d 0a 20 |object *|obj ).. |
|00001090| 20 20 20 2d 20 20 20 20 | 2d 20 20 20 20 20 20 20 | - |- |
|000010a0| 20 20 20 20 20 20 20 20 | 20 2d 0d 0a 7b 0d 0a 20 | | -..{.. |
|000010b0| 20 20 20 46 49 4c 45 20 | 2a 66 70 3b 0d 0a 20 20 | FILE |*fp;.. |
|000010c0| 20 20 69 6e 74 20 69 2c | 6a 3b 0d 0a 0d 0a 20 20 | int i,|j;.... |
|000010d0| 20 20 69 66 20 28 21 28 | 66 70 20 3d 20 66 6f 70 | if (!(|fp = fop|
|000010e0| 65 6e 28 67 65 6f 6d 20 | 66 69 6c 65 2c 22 72 22 |en(geom |file,"r"|
|000010f0| 29 29 29 20 20 20 20 20 | 20 20 20 20 20 20 2f 2a |))) | /*|
|00001100| 20 4f 70 65 6e 20 74 68 | 65 20 2e 67 65 6f 6d 20 | Open th|e .geom |
|00001110| 66 69 6c 65 20 2a 2f 0d | 0a 20 20 20 20 20 20 20 |file */.|. |
|00001120| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001130| 20 20 2d 0d 0a 20 20 20 | 20 20 20 20 20 72 65 74 | -.. | ret|
|00001140| 75 72 6e 20 2d 31 3b 0d | 0a 0d 0a 20 20 20 20 20 |urn -1;.|... |
|00001150| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001160| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001170| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 47 65 | | /* Ge|
|00001180| 74 20 68 65 61 64 65 72 | 20 69 6e 66 6f 72 6d 61 |t header| informa|
|00001190| 74 69 6f 6e 20 2a 2f 0d | 0a 20 20 20 20 66 73 63 |tion */.|. fsc|
|000011a0| 61 6e 66 28 66 70 2c 22 | 25 64 20 25 64 20 25 64 |anf(fp,"|%d %d %d|
|000011b0| 22 2c 26 6f 62 6a 2e 6e | 70 74 73 2c 26 6f 62 6a |",&obj.n|pts,&obj|
|000011c0| 2e 6e 70 6f 6c 79 73 2c | 26 6f 62 6a 2e 6e 73 65 |.npolys,|&obj.nse|
|000011d0| 67 73 29 3b 0d 0a 0d 0a | 20 20 20 20 20 20 20 20 |gs);....| |
|000011e0| 2f 2a 0d 0a 20 20 20 20 | 20 20 20 20 2a 2a 20 41 |/*.. | ** A|
|000011f0| 6c 6c 6f 63 61 74 65 20 | 72 6f 6f 6d 20 66 6f 72 |llocate |room for|
|00001200| 20 74 68 65 20 70 6f 69 | 6e 74 73 2e 0d 0a 20 20 | the poi|nts... |
|00001210| 20 20 20 20 20 20 2a 2f | 0d 0a 20 20 20 20 6f 62 | */|.. ob|
|00001220| 6a 2e 70 6f 69 6e 74 20 | 78 20 3d 20 28 64 6f 75 |j.point |x = (dou|
|00001230| 62 6c 65 20 2a 29 6d 61 | 6c 6c 6f 63 28 6f 62 6a |ble *)ma|lloc(obj|
|00001240| 2e 6e 70 74 73 2a 73 69 | 7a 65 6f 66 28 64 6f 75 |.npts*si|zeof(dou|
|00001250| 62 6c 65 29 29 3b 0d 0a | 20 20 20 20 20 20 20 20 |ble));..| |
|00001260| 20 20 20 20 20 2d 0d 0a | 20 20 20 20 6f 62 6a 2e | -..| obj.|
|00001270| 70 6f 69 6e 74 20 79 20 | 3d 20 28 64 6f 75 62 6c |point y |= (doubl|
|00001280| 65 20 2a 29 6d 61 6c 6c | 6f 63 28 6f 62 6a 2e 6e |e *)mall|oc(obj.n|
|00001290| 70 74 73 2a 73 69 7a 65 | 6f 66 28 64 6f 75 62 6c |pts*size|of(doubl|
|000012a0| 65 29 29 3b 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |e));.. | |
|000012b0| 20 20 20 2d 0d 0a 20 20 | 20 20 6f 62 6a 2e 70 6f | -.. | obj.po|
|000012c0| 69 6e 74 20 7a 20 3d 20 | 28 64 6f 75 62 6c 65 20 |int z = |(double |
|000012d0| 2a 29 6d 61 6c 6c 6f 63 | 28 6f 62 6a 2e 6e 70 74 |*)malloc|(obj.npt|
|000012e0| 73 2a 73 69 7a 65 6f 66 | 28 64 6f 75 62 6c 65 29 |s*sizeof|(double)|
|000012f0| 29 3b 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |);.. | |
|00001300| 20 2d 0d 0a 0d 0a 20 20 | 20 20 66 6f 72 20 28 69 | -.... | for (i|
|00001310| 3d 30 3b 69 3c 6f 62 6a | 2e 6e 70 74 73 3b 2b 2b |=0;i<obj|.npts;++|
|00001320| 69 29 0d 0a 20 20 20 20 | 20 20 20 20 66 73 63 61 |i).. | fsca|
|00001330| 6e 66 28 66 70 2c 22 25 | 6c 66 20 25 6c 66 20 25 |nf(fp,"%|lf %lf %|
|00001340| 6c 66 22 2c 26 6f 62 6a | 2e 70 6f 69 6e 74 20 78 |lf",&obj|.point x|
|00001350| 5b 69 5d 2c 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |[i],.. | |
|00001360| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001370| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001380| 2d 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |-.. | |
|00001390| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000013a0| 20 20 20 26 6f 62 6a 2e | 70 6f 69 6e 74 20 79 5b | &obj.|point y[|
|000013b0| 69 5d 2c 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |i],.. | |
|000013c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000013d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2d | | -|
|000013e0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|000013f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001400| 20 20 26 6f 62 6a 2e 70 | 6f 69 6e 74 20 7a 5b 69 | &obj.p|oint z[i|
|00001410| 5d 29 3b 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |]);.. | |
|00001420| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001430| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 2d | | -|
|00001440| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 20 2f 2a 20 41 |.... | /* A|
|00001450| 6c 6c 6f 63 61 74 65 20 | 72 6f 6f 6d 20 66 6f 72 |llocate |room for|
|00001460| 20 74 68 65 20 70 6f 6c | 79 67 6f 6e 73 2e 20 20 | the pol|ygons. |
|00001470| 2a 2f 0d 0a 20 20 20 20 | 6f 62 6a 2e 70 6f 6c 79 |*/.. |obj.poly|
|00001480| 73 20 3d 20 28 73 74 72 | 75 63 74 20 70 6f 6c 79 |s = (str|uct poly|
|00001490| 67 6f 6e 20 2a 29 6d 61 | 6c 6c 6f 63 28 6f 62 6a |gon *)ma|lloc(obj|
|000014a0| 2e 6e 70 6f 6c 79 73 2a | 73 69 7a 65 6f 66 28 73 |.npolys*|sizeof(s|
|000014b0| 74 72 75 63 74 20 70 6f | 6c 79 67 6f 6e 29 29 3b |truct po|lygon));|
|000014c0| 0d 0a 0d 0a 20 20 20 20 | 66 6f 72 20 28 69 3d 30 |.... |for (i=0|
|000014d0| 3b 69 3c 6f 62 6a 2e 6e | 70 74 73 3b 2b 2b 69 29 |;i<obj.n|pts;++i)|
|000014e0| 20 7b 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | {.. | |
|000014f0| 2f 2a 20 53 65 65 20 68 | 6f 77 20 6d 61 6e 79 20 |/* See h|ow many |
|00001500| 76 65 72 74 69 63 65 73 | 20 74 68 69 73 20 68 61 |vertices| this ha|
|00001510| 73 20 2a 2f 0d 0a 20 20 | 20 20 20 20 20 20 66 73 |s */.. | fs|
|00001520| 63 61 6e 66 28 66 70 2c | 22 25 64 22 2c 26 6f 62 |canf(fp,|"%d",&ob|
|00001530| 6a 2e 70 6f 6c 79 73 5b | 69 5d 2e 6e 76 65 72 74 |j.polys[|i].nvert|
|00001540| 29 3b 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |);.... | |
|00001550| 20 20 2f 2a 20 41 6c 6c | 6f 63 61 74 65 20 72 6f | /* All|ocate ro|
|00001560| 6f 6d 20 66 6f 72 20 76 | 65 72 74 69 63 65 73 20 |om for v|ertices |
|00001570| 2a 2f 0d 0a 20 20 20 20 | 20 20 20 20 6f 62 6a 2e |*/.. | obj.|
|00001580| 70 6f 6c 79 73 5b 69 5d | 2e 76 65 72 74 73 20 3d |polys[i]|.verts =|
|00001590| 20 28 69 6e 74 20 2a 29 | 6d 61 6c 6c 6f 63 28 6f | (int *)|malloc(o|
|000015a0| 62 6a 2e 6e 70 6f 6c 79 | 73 2a 73 69 7a 65 6f 66 |bj.npoly|s*sizeof|
|000015b0| 28 69 6e 74 29 29 3b 0d | 0a 0d 0a 20 20 20 20 20 |(int));.|... |
|000015c0| 20 20 20 20 20 20 20 2f | 2a 20 47 65 74 20 65 61 | /|* Get ea|
|000015d0| 63 68 20 76 65 72 74 65 | 78 20 2a 2f 0d 0a 20 20 |ch verte|x */.. |
|000015e0| 20 20 20 20 20 20 66 6f | 72 20 28 6a 3d 30 3b 6a | fo|r (j=0;j|
|000015f0| 3c 6f 62 6a 2e 70 6f 6c | 79 73 5b 69 5d 2e 6e 76 |<obj.pol|ys[i].nv|
|00001600| 65 72 74 3b 2b 2b 6a 29 | 0d 0a 20 20 20 20 20 20 |ert;++j)|.. |
|00001610| 20 20 20 20 20 20 66 73 | 63 61 6e 66 28 66 70 2c | fs|canf(fp,|
|00001620| 22 25 64 22 2c 26 6f 62 | 6a 2e 70 6f 6c 79 73 5b |"%d",&ob|j.polys[|
|00001630| 69 5d 2e 76 65 72 74 73 | 5b 6a 5d 29 3b 0d 0a 20 |i].verts|[j]);.. |
|00001640| 20 20 20 7d 0d 0a 7d 0d | 0a 0d 0a 33 29 20 48 6f | }..}.|...3) Ho|
|00001650| 77 20 64 6f 20 49 20 64 | 65 66 69 6e 65 20 73 70 |w do I d|efine sp|
|00001660| 61 63 65 3f 0d 0a 0d 0a | 20 20 20 20 20 54 68 65 |ace?....| The|
|00001670| 72 65 20 61 72 65 20 73 | 65 76 65 72 61 6c 20 74 |re are s|everal t|
|00001680| 68 69 6e 67 73 20 74 6f | 20 63 6f 6e 73 69 64 65 |hings to| conside|
|00001690| 72 20 77 68 65 6e 20 70 | 69 63 6b 69 6e 67 20 61 |r when p|icking a|
|000016a0| 20 63 6f 6f 72 64 69 6e | 61 74 65 20 73 79 73 2d | coordin|ate sys-|
|000016b0| 0d 0a 74 65 6d 2e 20 20 | 4d 6f 73 74 20 69 6d 70 |..tem. |Most imp|
|000016c0| 6f 72 74 61 6e 74 20 6f | 66 20 74 68 65 73 65 20 |ortant o|f these |
|000016d0| 69 73 20 68 6f 77 20 79 | 6f 75 20 69 6e 74 65 6e |is how y|ou inten|
|000016e0| 64 20 74 6f 20 68 61 6e | 64 6c 65 20 6f 62 6a 65 |d to han|dle obje|
|000016f0| 63 74 73 2e 20 20 49 66 | 0d 0a 79 6f 75 72 20 6f |cts. If|..your o|
|00001700| 62 6a 65 63 74 73 20 61 | 72 65 20 64 65 66 69 6e |bjects a|re defin|
|00001710| 65 64 20 69 6e 20 74 65 | 72 6d 73 20 6f 66 20 3c |ed in te|rms of <|
|00001720| 78 2c 79 2c 7a 3e 20 74 | 72 69 70 6c 65 74 73 2c |x,y,z> t|riplets,|
|00001730| 20 69 74 20 77 69 6c 6c | 20 72 65 71 75 69 72 65 | it will| require|
|00001740| 20 61 0d 0a 0d 0a 66 61 | 69 72 20 62 69 74 20 6f | a....fa|ir bit o|
|00001750| 66 20 77 6f 72 6b 20 6f | 6e 20 72 65 61 64 69 6e |f work o|n readin|
|00001760| 67 20 74 68 65 6d 20 69 | 6e 20 74 6f 20 74 75 72 |g them i|n to tur|
|00001770| 6e 20 74 68 65 6d 20 69 | 6e 74 6f 20 73 70 68 65 |n them i|nto sphe|
|00001780| 72 69 63 61 6c 0d 0a 0d | 0a 63 6f 6f 72 64 69 6e |rical...|.coordin|
|00001790| 61 74 65 73 2e 20 20 49 | 66 20 79 6f 75 27 72 65 |ates. I|f you're|
|000017a0| 20 6c 6f 6f 6b 69 6e 67 | 20 74 6f 20 74 68 69 73 | looking| to this|
|000017b0| 20 46 41 51 20 66 6f 72 | 20 69 6e 66 6f 72 6d 61 | FAQ for| informa|
|000017c0| 74 69 6f 6e 20 6f 6e 20 | 68 6f 77 20 74 6f 0d 0a |tion on |how to..|
|000017d0| 64 65 66 69 6e 65 20 74 | 68 65 20 73 70 61 63 65 |define t|he space|
|000017e0| 20 79 6f 75 72 20 6f 62 | 6a 65 63 74 73 20 77 69 | your ob|jects wi|
|000017f0| 6c 6c 20 62 65 20 69 6e | 2c 20 49 27 64 20 73 74 |ll be in|, I'd st|
|00001800| 72 6f 6e 67 6c 79 20 73 | 75 67 67 65 73 74 20 75 |rongly s|uggest u|
|00001810| 73 69 6e 67 0d 0a 72 65 | 63 74 61 6e 67 75 6c 61 |sing..re|ctangula|
|00001820| 72 20 63 6f 6f 72 64 69 | 6e 61 74 65 73 20 61 6e |r coordi|nates an|
|00001830| 64 20 73 6f 6d 65 20 64 | 65 72 69 76 61 74 69 76 |d some d|erivativ|
|00001840| 65 20 6f 66 20 74 68 65 | 20 4f 46 46 2d 66 6f 72 |e of the| OFF-for|
|00001850| 6d 61 74 2e 0d 0a 0d 0a | 20 20 20 20 20 46 6f 72 |mat.....| For|
|00001860| 20 73 74 61 72 74 65 72 | 73 2c 20 6c 65 74 20 6d | starter|s, let m|
|00001870| 65 20 6a 75 73 74 20 74 | 68 72 6f 77 20 69 6e 20 |e just t|hrow in |
|00001880| 74 68 61 74 20 77 68 69 | 6c 65 20 6f 75 72 20 75 |that whi|le our u|
|00001890| 6e 69 76 65 72 73 65 20 | 6d 61 79 20 62 65 0d 0a |niverse |may be..|
|000018a0| 69 6e 66 69 6e 69 74 65 | 20 69 6e 20 61 6c 6c 20 |infinite| in all |
|000018b0| 64 69 72 65 63 74 69 6f | 6e 73 2c 20 74 68 61 74 |directio|ns, that|
|000018c0| 20 64 6f 65 73 6e 27 74 | 20 6d 61 6b 65 20 66 6f | doesn't| make fo|
|000018d0| 72 20 67 6f 6f 64 20 70 | 72 6f 67 72 61 6d 6d 69 |r good p|rogrammi|
|000018e0| 6e 67 2e 20 20 57 65 0d | 0a 68 61 76 65 20 74 6f |ng. We.|.have to|
|000018f0| 20 6c 69 6d 69 74 20 6f | 75 72 73 65 6c 76 65 73 | limit o|urselves|
|00001900| 20 74 6f 20 73 6d 61 6c | 6c 20 65 6e 6f 75 67 68 | to smal|l enough|
|00001910| 20 6e 75 6d 62 65 72 73 | 20 74 68 61 74 20 77 65 | numbers| that we|
|00001920| 20 63 61 6e 20 6d 75 6c | 74 69 70 6c 79 0d 0a 74 | can mul|tiply..t|
|00001930| 68 65 6d 20 74 6f 67 65 | 74 68 65 72 20 77 69 74 |hem toge|ther wit|
|00001940| 68 6f 75 74 20 6f 76 65 | 72 66 6c 6f 77 69 6e 67 |hout ove|rflowing|
|00001950| 20 74 68 65 6d 2c 20 77 | 65 20 63 61 6e 20 64 69 | them, w|e can di|
|00001960| 76 69 64 65 20 74 68 65 | 6d 20 77 69 74 68 6f 75 |vide the|m withou|
|00001970| 74 0d 0a 63 72 61 73 68 | 69 6e 67 20 6f 75 72 20 |t..crash|ing our |
|00001980| 73 79 73 74 65 6d 73 2c | 20 61 6e 64 20 77 65 20 |systems,| and we |
|00001990| 63 61 6e 20 61 64 64 20 | 74 68 65 6d 20 77 69 74 |can add |them wit|
|000019a0| 68 6f 75 74 20 61 63 63 | 69 64 65 6e 74 61 6c 6c |hout acc|identall|
|000019b0| 79 20 66 6c 69 70 70 69 | 6e 67 0d 0a 61 20 73 69 |y flippi|ng..a si|
|000019c0| 67 6e 20 62 69 74 2e 0d | 0a 0d 0a 20 20 20 20 20 |gn bit..|... |
|000019d0| 4e 6f 77 2c 20 74 68 65 | 20 66 75 6e 20 62 65 67 |Now, the| fun beg|
|000019e0| 69 6e 73 2e 20 20 54 68 | 65 20 73 69 6d 70 6c 65 |ins. Th|e simple|
|000019f0| 73 74 20 66 6f 72 6d 20 | 6f 66 20 64 65 66 69 6e |st form |of defin|
|00001a00| 69 6e 67 20 74 68 65 20 | 55 6e 69 76 65 72 73 65 |ing the |Universe|
|00001a10| 20 69 73 0d 0a 74 6f 20 | 66 6c 61 74 20 6f 75 74 | is..to |flat out|
|00001a20| 20 73 61 79 20 74 68 61 | 74 20 74 68 65 20 55 6e | say tha|t the Un|
|00001a30| 69 76 65 72 73 65 20 73 | 74 72 65 74 63 68 65 73 |iverse s|tretches|
|00001a40| 20 6f 76 65 72 20 74 68 | 65 73 65 20 63 6f 6f 72 | over th|ese coor|
|00001a50| 64 69 6e 61 74 65 73 2c | 20 73 61 79 0d 0a 69 6e |dinates,| say..in|
|00001a60| 20 74 68 65 20 62 6f 75 | 6e 64 69 6e 67 20 62 6f | the bou|nding bo|
|00001a70| 78 20 6f 66 20 3c 2d 36 | 35 35 33 36 2c 20 2d 36 |x of <-6|5536, -6|
|00001a80| 35 35 33 36 2c 20 2d 36 | 35 35 33 36 3e 20 74 6f |5536, -6|5536> to|
|00001a90| 20 3c 36 35 35 33 36 2c | 20 36 35 35 33 36 2c 0d | <65536,| 65536,.|
|00001aa0| 0a 36 35 35 33 36 3e 2e | 20 20 54 68 69 73 20 69 |.65536>.| This i|
|00001ab0| 73 20 6f 66 74 65 6e 20 | 72 65 66 65 72 72 65 64 |s often |referred|
|00001ac0| 20 74 6f 20 61 73 20 61 | 20 55 6e 69 76 65 72 73 | to as a| Univers|
|00001ad0| 61 6c 20 43 6f 6f 72 64 | 69 6e 61 74 65 20 73 79 |al Coord|inate sy|
|00001ae0| 73 74 65 6d 20 6f 72 0d | 0a 61 6e 20 41 62 73 6f |stem or.|.an Abso|
|00001af0| 6c 75 74 65 20 43 6f 6f | 72 64 69 6e 61 74 65 20 |lute Coo|rdinate |
|00001b00| 73 79 73 74 65 6d 2e 20 | 20 54 68 65 6e 2c 20 65 |system. | Then, e|
|00001b10| 61 63 68 20 6f 62 6a 65 | 63 74 20 69 6e 20 74 68 |ach obje|ct in th|
|00001b20| 65 20 55 6e 69 76 65 72 | 73 65 20 77 69 6c 6c 0d |e Univer|se will.|
|00001b30| 0a 62 65 20 63 65 6e 74 | 65 72 65 64 20 61 62 6f |.be cent|ered abo|
|00001b40| 75 74 20 73 6f 6d 65 20 | 63 6f 6f 72 64 69 6e 61 |ut some |coordina|
|00001b50| 74 65 20 69 6e 20 74 68 | 61 74 20 72 61 6e 67 65 |te in th|at range|
|00001b60| 2e 20 20 54 68 69 73 20 | 69 6e 63 6c 75 64 65 73 |. This |includes|
|00001b70| 20 79 6f 75 72 0d 0a 76 | 69 65 77 70 6f 69 6e 74 | your..v|iewpoint|
|00001b80| 2e 20 20 53 65 76 65 72 | 61 6c 20 73 74 72 61 74 |. Sever|al strat|
|00001b90| 65 67 69 65 73 20 61 72 | 65 20 61 76 61 69 6c 61 |egies ar|e availa|
|00001ba0| 62 6c 65 20 66 6f 72 20 | 64 65 61 6c 69 6e 67 20 |ble for |dealing |
|00001bb0| 77 69 74 68 20 74 68 65 | 20 65 64 67 65 0d 0a 6f |with the| edge..o|
|00001bc0| 66 20 74 68 65 20 55 6e | 69 76 65 72 73 65 2e 20 |f the Un|iverse. |
|00001bd0| 20 4f 6e 65 20 63 61 6e | 20 6d 61 6b 65 20 74 68 | One can| make th|
|00001be0| 65 20 55 6e 69 76 65 72 | 73 65 20 77 72 61 70 20 |e Univer|se wrap |
|00001bf0| 61 72 6f 75 6e 64 20 73 | 6f 20 74 68 61 74 20 61 |around s|o that a|
|00001c00| 6e 0d 0a 6f 62 6a 65 63 | 74 20 6c 65 61 76 69 6e |n..objec|t leavin|
|00001c10| 67 20 74 68 65 20 63 75 | 62 65 20 61 74 20 3c 20 |g the cu|be at < |
|00001c20| 58 2c 20 59 2c 20 36 35 | 35 33 36 3e 20 77 69 6c |X, Y, 65|536> wil|
|00001c30| 6c 20 72 65 2d 61 70 70 | 65 61 72 20 69 6e 20 74 |l re-app|ear in t|
|00001c40| 68 65 20 55 6e 69 76 65 | 72 73 65 0d 0a 61 74 20 |he Unive|rse..at |
|00001c50| 3c 20 58 2c 20 59 2c 20 | 2d 36 35 35 33 36 3e 2e |< X, Y, |-65536>.|
|00001c60| 20 20 4f 72 2c 20 6f 6e | 65 20 63 61 6e 20 6d 61 | Or, on|e can ma|
|00001c70| 6b 65 20 6f 62 6a 65 63 | 74 73 20 62 6f 75 6e 63 |ke objec|ts bounc|
|00001c80| 65 20 6f 72 20 73 74 6f | 70 20 61 74 20 74 68 65 |e or sto|p at the|
|00001c90| 20 65 64 67 65 0d 0a 6f | 66 20 74 68 65 20 55 6e | edge..o|f the Un|
|00001ca0| 69 76 65 72 73 65 2e 20 | 20 41 6e 64 2c 20 67 69 |iverse. | And, gi|
|00001cb0| 76 65 6e 20 61 6e 79 20 | 61 70 70 72 6f 61 63 68 |ven any |approach|
|00001cc0| 2c 20 6f 6e 65 20 63 61 | 6e 20 68 61 76 65 20 74 |, one ca|n have t|
|00001cd0| 68 65 20 65 64 67 65 20 | 6f 66 20 74 68 65 0d 0a |he edge |of the..|
|00001ce0| 55 6e 69 76 65 72 73 65 | 20 62 65 20 74 72 61 6e |Universe| be tran|
|00001cf0| 73 70 61 72 65 6e 74 20 | 6f 72 20 6f 70 61 71 75 |sparent |or opaqu|
|00001d00| 65 2e 0d 0a 0d 0a 20 20 | 20 20 20 49 6e 20 61 6e |e..... | In an|
|00001d10| 20 41 62 73 6f 6c 75 74 | 65 20 43 6f 6f 72 64 69 | Absolut|e Coordi|
|00001d20| 6e 61 74 65 20 73 79 73 | 74 65 6d 2c 20 61 6c 6c |nate sys|tem, all|
|00001d30| 20 6f 62 6a 65 63 74 73 | 20 6d 75 73 74 20 62 65 | objects| must be|
|00001d40| 20 73 68 6f 77 6e 20 66 | 72 6f 6d 0d 0a 74 68 65 | shown f|rom..the|
|00001d50| 20 70 6f 73 69 74 69 6f | 6e 20 6f 66 20 79 6f 75 | positio|n of you|
|00001d60| 72 20 76 69 65 77 70 6f | 69 6e 74 2e 20 20 54 68 |r viewpo|int. Th|
|00001d70| 69 73 20 69 6e 76 6f 6c | 76 65 73 20 6c 6f 74 73 |is invol|ves lots|
|00001d80| 20 6f 66 20 69 6e 74 65 | 72 65 73 74 69 6e 67 20 | of inte|resting |
|00001d90| 6d 61 74 68 0d 0a 74 68 | 61 74 20 77 65 27 6c 6c |math..th|at we'll|
|00001da0| 20 67 65 74 20 69 6e 74 | 6f 20 6c 61 74 65 72 2e | get int|o later.|
|00001db0| 20 20 42 75 74 2c 20 69 | 6e 20 67 65 6e 65 72 61 | But, i|n genera|
|00001dc0| 6c 2c 20 61 6e 20 6f 62 | 6a 65 63 74 73 20 70 6f |l, an ob|jects po|
|00001dd0| 73 69 74 69 6f 6e 20 77 | 69 74 68 0d 0a 72 65 73 |sition w|ith..res|
|00001de0| 70 65 63 74 20 74 6f 20 | 79 6f 75 20 69 73 20 69 |pect to |you is i|
|00001df0| 74 27 73 20 61 62 73 6f | 6c 75 74 65 20 70 6f 73 |t's abso|lute pos|
|00001e00| 69 74 69 6f 6e 20 2d 20 | 79 6f 75 72 20 61 62 73 |ition - |your abs|
|00001e10| 6f 6c 75 74 65 20 70 6f | 73 69 74 69 6f 6e 20 28 |olute po|sition (|
|00001e20| 77 69 74 68 0d 0a 61 6c | 6c 20 6b 69 6e 64 73 20 |with..al|l kinds |
|00001e30| 6f 66 20 68 65 6c 6c 20 | 62 72 65 61 6b 69 6e 67 |of hell |breaking|
|00001e40| 20 6c 6f 6f 73 65 20 69 | 66 20 79 6f 75 20 63 61 | loose i|f you ca|
|00001e50| 6e 20 73 65 65 20 70 61 | 73 74 20 74 68 65 20 65 |n see pa|st the e|
|00001e60| 64 67 65 20 6f 66 20 74 | 68 65 0d 0a 55 6e 69 76 |dge of t|he..Univ|
|00001e70| 65 72 73 65 29 2e 20 20 | 54 68 65 6e 2c 20 61 66 |erse). |Then, af|
|00001e80| 74 65 72 20 74 68 69 73 | 20 70 6f 73 69 74 69 6f |ter this| positio|
|00001e90| 6e 20 69 73 20 63 61 6c | 63 75 6c 61 74 65 64 2c |n is cal|culated,|
|00001ea0| 20 69 74 20 6d 75 73 74 | 20 62 65 20 72 6f 74 61 | it must| be rota|
|00001eb0| 74 65 64 0d 0a 62 61 73 | 65 64 20 6f 6e 20 79 6f |ted..bas|ed on yo|
|00001ec0| 75 72 20 6f 72 69 65 6e | 74 61 74 69 6f 6e 20 69 |ur orien|tation i|
|00001ed0| 6e 20 74 68 65 20 55 6e | 69 76 65 72 73 65 2e 0d |n the Un|iverse..|
|00001ee0| 0a 0d 0a 20 20 20 20 20 | 41 6e 6f 74 68 65 72 20 |... |Another |
|00001ef0| 70 6f 73 73 69 62 69 6c | 69 74 79 20 66 6f 72 20 |possibil|ity for |
|00001f00| 64 65 66 69 6e 69 6e 67 | 20 73 70 61 63 65 20 69 |defining| space i|
|00001f10| 73 20 61 20 52 65 6c 61 | 74 69 76 65 20 43 6f 6f |s a Rela|tive Coo|
|00001f20| 72 64 69 6e 61 74 65 0d | 0a 73 79 73 74 65 6d 20 |rdinate.|.system |
|00001f30| 6f 72 20 61 20 56 69 65 | 77 2d 43 65 6e 74 65 72 |or a Vie|w-Center|
|00001f40| 65 64 20 43 6f 6f 72 64 | 69 6e 61 74 65 20 73 79 |ed Coord|inate sy|
|00001f50| 73 74 65 6d 2e 20 20 49 | 6e 20 74 68 69 73 20 73 |stem. I|n this s|
|00001f60| 6f 72 74 20 6f 66 20 73 | 79 73 74 65 6d 2c 0d 0a |ort of s|ystem,..|
|00001f70| 74 68 65 20 56 69 65 77 | 70 6f 69 6e 74 20 69 73 |the View|point is|
|00001f80| 20 61 6c 77 61 79 73 20 | 61 74 20 63 6f 6f 72 64 | always |at coord|
|00001f90| 69 6e 61 74 65 73 20 3c | 30 2c 30 2c 30 3e 20 61 |inates <|0,0,0> a|
|00001fa0| 6e 64 20 65 76 65 72 79 | 74 68 69 6e 67 20 65 6c |nd every|thing el|
|00001fb0| 73 65 20 69 6e 0d 0a 74 | 68 65 20 55 6e 69 76 65 |se in..t|he Unive|
|00001fc0| 72 73 65 20 69 73 20 62 | 61 73 65 64 20 72 65 6c |rse is b|ased rel|
|00001fd0| 61 74 69 76 65 6c 79 20 | 74 6f 20 74 68 69 73 20 |atively |to this |
|00001fe0| 68 6f 6d 65 20 70 6f 73 | 69 74 69 6f 6e 2e 20 20 |home pos|ition. |
|00001ff0| 54 68 69 73 20 63 61 75 | 73 65 73 0d 0a 66 75 6e |This cau|ses..fun|
|00002000| 6b 79 20 6d 61 74 68 20 | 74 6f 20 63 6f 6d 65 20 |ky math |to come |
|00002010| 69 6e 74 6f 20 70 6c 61 | 79 20 77 68 65 6e 20 64 |into pla|y when d|
|00002020| 65 61 6c 69 6e 67 20 77 | 69 74 68 20 76 65 6c 6f |ealing w|ith velo|
|00002030| 63 69 74 69 65 73 20 6f | 66 20 6f 62 6a 65 63 74 |cities o|f object|
|00002040| 73 2c 0d 0a 62 75 74 2e | 2e 2e 20 69 74 20 64 6f |s,..but.|.. it do|
|00002050| 65 73 20 77 6f 6e 64 65 | 72 73 20 66 6f 72 20 6e |es wonde|rs for n|
|00002060| 6f 74 20 68 61 76 69 6e | 67 20 74 6f 20 64 65 61 |ot havin|g to dea|
|00002070| 6c 20 77 69 74 68 20 74 | 68 65 20 27 65 64 67 65 |l with t|he 'edge|
|00002080| 20 6f 66 20 74 68 65 0d | 0a 55 6e 69 76 65 72 73 | of the.|.Univers|
|00002090| 65 27 2e 20 20 54 68 69 | 73 20 69 73 20 74 68 65 |e'. Thi|s is the|
|000020a0| 20 53 63 68 72 6f 65 64 | 69 6e 67 65 72 27 73 20 | Schroed|inger's |
|000020b0| 63 61 74 20 6d 65 74 68 | 6f 64 20 6f 66 20 74 68 |cat meth|od of th|
|000020c0| 65 20 27 65 64 67 65 20 | 6f 66 20 74 68 65 0d 0a |e 'edge |of the..|
|000020d0| 55 6e 69 76 65 72 73 65 | 27 2e 2e 2e 2e 20 69 6e |Universe|'.... in|
|000020e0| 20 74 68 65 20 74 72 75 | 65 73 74 20 73 65 6e 73 | the tru|est sens|
|000020f0| 65 20 6f 66 20 6f 75 74 | 20 6f 66 20 73 69 67 68 |e of out| of sigh|
|00002100| 74 20 69 73 20 6f 75 74 | 20 6f 66 20 6d 69 6e 64 |t is out| of mind|
|00002110| 2e 20 20 53 6d 61 6c 6c | 0d 0a 70 72 6f 76 69 73 |. Small|..provis|
|00002120| 69 6f 6e 73 20 68 61 76 | 65 20 74 6f 20 62 65 20 |ions hav|e to be |
|00002130| 6d 61 64 65 20 69 66 20 | 6f 62 6a 65 63 74 73 20 |made if |objects |
|00002140| 61 72 65 6e 27 74 20 74 | 6f 20 77 72 61 70 20 61 |aren't t|o wrap a|
|00002150| 72 6f 75 6e 64 2e 20 20 | 42 75 74 2e 2e 2e 20 61 |round. |But... a|
|00002160| 0d 0a 52 65 6c 61 74 69 | 76 65 20 43 6f 6f 72 64 |..Relati|ve Coord|
|00002170| 69 6e 61 74 65 20 73 79 | 73 74 65 6d 20 63 61 6e |inate sy|stem can|
|00002180| 20 62 65 20 75 73 65 64 | 20 74 6f 20 67 69 76 65 | be used| to give|
|00002190| 20 74 68 65 20 69 6c 6c | 75 73 69 6f 6e 20 6f 66 | the ill|usion of|
|000021a0| 20 69 6e 66 69 6e 69 74 | 65 0d 0a 73 70 61 63 65 | infinit|e..space|
|000021b0| 20 6f 6e 20 61 20 66 69 | 6e 69 74 65 20 6d 61 63 | on a fi|nite mac|
|000021c0| 68 69 6e 65 2e 20 20 28 | 59 65 73 2c 20 65 76 65 |hine. (|Yes, eve|
|000021d0| 6e 20 79 6f 75 72 20 34 | 38 36 2f 36 36 44 58 20 |n your 4|86/66DX |
|000021e0| 69 73 20 66 69 6e 69 74 | 65 29 2e 0d 0a 0d 0a 20 |is finit|e)..... |
|000021f0| 20 20 20 20 49 27 6c 6c | 20 6c 65 61 76 65 20 73 | I'll| leave s|
|00002200| 70 68 65 72 69 63 61 6c | 20 63 6f 6f 72 64 69 6e |pherical| coordin|
|00002210| 61 74 65 73 20 74 6f 20 | 61 20 6c 61 74 65 72 20 |ates to |a later |
|00002220| 76 65 72 73 69 6f 6e 20 | 69 66 20 70 65 6f 70 6c |version |if peopl|
|00002230| 65 20 74 68 69 6e 6b 0d | 0a 74 68 65 79 27 6c 6c |e think.|.they'll|
|00002240| 20 62 65 20 6f 66 20 75 | 73 65 2e 2e 2e 0d 0a 0d | be of u|se......|
|00002250| 0a 34 29 20 48 6f 77 20 | 64 6f 20 49 20 64 65 66 |.4) How |do I def|
|00002260| 69 6e 65 20 70 6f 73 69 | 74 69 6f 6e 3f 0d 0a 0d |ine posi|tion?...|
|00002270| 0a 20 20 20 20 20 50 6f | 73 69 74 69 6f 6e 20 69 |. Po|sition i|
|00002280| 6e 20 61 6e 20 41 62 73 | 6f 6c 75 74 65 20 43 6f |n an Abs|olute Co|
|00002290| 6f 72 64 69 6e 61 74 65 | 20 73 79 73 74 65 6d 20 |ordinate| system |
|000022a0| 69 73 20 65 61 73 79 2e | 20 20 45 61 63 68 20 6f |is easy.| Each o|
|000022b0| 62 6a 65 63 74 20 68 61 | 73 0d 0a 74 68 72 65 65 |bject ha|s..three|
|000022c0| 20 63 6f 6f 72 64 69 6e | 61 74 65 73 2e 20 20 54 | coordin|ates. T|
|000022d0| 68 65 73 65 20 61 72 65 | 20 6f 66 74 65 6e 20 73 |hese are| often s|
|000022e0| 74 6f 72 65 64 20 69 6e | 20 61 20 64 61 74 61 2d |tored in| a data-|
|000022f0| 74 79 70 65 20 63 61 6c | 6c 65 64 20 61 20 76 65 |type cal|led a ve|
|00002300| 63 2d 0d 0a 74 6f 72 20 | 74 6f 20 61 62 73 74 72 |c-..tor |to abstr|
|00002310| 61 63 74 20 66 75 72 74 | 68 65 72 20 74 68 65 20 |act furt|her the |
|00002320| 6e 6f 74 69 6f 6e 20 74 | 68 61 74 20 74 68 65 73 |notion t|hat thes|
|00002330| 65 20 6e 75 6d 62 65 72 | 73 20 62 65 6c 6f 6e 67 |e number|s belong|
|00002340| 20 74 6f 67 65 74 68 65 | 72 2e 0d 0a 0d 0a 20 20 | togethe|r..... |
|00002350| 20 20 20 20 20 20 74 79 | 70 65 64 65 66 20 73 74 | ty|pedef st|
|00002360| 72 75 63 74 20 7b 0d 0a | 20 20 20 20 20 20 20 20 |ruct {..| |
|00002370| 20 20 20 20 20 20 20 20 | 6c 6f 6e 67 20 78 3b 0d | |long x;.|
|00002380| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00002390| 20 6c 6f 6e 67 20 79 3b | 0d 0a 20 20 20 20 20 20 | long y;|.. |
|000023a0| 20 20 20 20 20 20 20 20 | 20 20 6c 6f 6e 67 20 7a | | long z|
|000023b0| 3b 0d 0a 20 20 20 20 20 | 20 20 20 7d 20 56 45 43 |;.. | } VEC|
|000023c0| 54 3b 0d 0a 0d 0a 55 73 | 75 61 6c 6c 79 2c 20 65 |T;....Us|ually, e|
|000023d0| 61 63 68 20 6f 62 6a 65 | 63 74 20 69 6e 20 74 68 |ach obje|ct in th|
|000023e0| 65 20 55 6e 69 76 65 72 | 73 65 20 69 73 20 64 65 |e Univer|se is de|
|000023f0| 66 69 6e 65 64 20 61 62 | 6f 75 74 20 69 74 73 20 |fined ab|out its |
|00002400| 63 65 6e 74 65 72 20 77 | 69 74 68 0d 0a 65 61 63 |center w|ith..eac|
|00002410| 68 20 63 6f 6f 72 64 69 | 6e 61 74 65 20 6f 6e 20 |h coordi|nate on |
|00002420| 69 74 73 20 73 75 72 66 | 61 63 65 20 62 65 69 6e |its surf|ace bein|
|00002430| 67 20 63 65 6e 74 65 72 | 65 64 20 61 74 20 69 74 |g center|ed at it|
|00002440| 73 20 6f 77 6e 20 3c 30 | 2c 30 2c 30 3e 2e 20 20 |s own <0|,0,0>. |
|00002450| 54 68 69 73 0d 0a 0d 0a | 68 65 6c 70 73 20 74 72 |This....|helps tr|
|00002460| 65 6d 65 6e 64 6f 75 73 | 6c 79 20 69 6e 20 72 6f |emendous|ly in ro|
|00002470| 74 61 74 69 6e 67 20 74 | 68 65 20 6f 62 6a 65 63 |tating t|he objec|
|00002480| 74 2c 20 61 6e 64 20 49 | 20 77 6f 75 6c 64 20 68 |t, and I| would h|
|00002490| 69 67 68 6c 79 20 72 65 | 63 6f 6d 6d 65 6e 64 0d |ighly re|commend.|
|000024a0| 0a 0d 0a 74 68 69 73 2e | 20 20 54 68 65 6e 2c 20 |...this.| Then, |
|000024b0| 74 68 65 20 6f 62 6a 65 | 63 74 20 61 73 20 61 20 |the obje|ct as a |
|000024c0| 77 68 6f 6c 65 20 69 73 | 20 67 69 76 65 6e 20 61 |whole is| given a|
|000024d0| 20 70 6f 73 69 74 69 6f | 6e 20 69 6e 20 73 70 61 | positio|n in spa|
|000024e0| 63 65 2e 20 20 57 68 65 | 6e 0d 0a 69 74 20 63 6f |ce. Whe|n..it co|
|000024f0| 6d 65 73 20 74 69 6d 65 | 20 74 6f 20 64 72 61 77 |mes time| to draw|
|00002500| 20 74 68 69 73 20 6f 62 | 6a 65 63 74 2c 20 69 74 | this ob|ject, it|
|00002510| 73 20 70 6f 69 6e 74 73 | 27 20 63 6f 6f 72 64 69 |s points|' coordi|
|00002520| 6e 61 74 65 73 20 67 65 | 74 20 61 64 64 65 64 20 |nates ge|t added |
|00002530| 6f 6e 0d 0a 74 6f 20 69 | 74 73 20 70 6f 73 69 74 |on..to i|ts posit|
|00002540| 69 6f 6e 2e 0d 0a 0d 0a | 20 20 20 20 20 49 6e 20 |ion.....| In |
|00002550| 61 20 52 65 6c 61 74 69 | 76 65 20 43 6f 6f 72 64 |a Relati|ve Coord|
|00002560| 69 6e 61 74 65 20 73 79 | 73 74 65 6d 2c 20 70 6f |inate sy|stem, po|
|00002570| 73 69 74 69 6f 6e 20 69 | 73 20 61 6c 73 6f 20 66 |sition i|s also f|
|00002580| 61 69 72 6c 79 20 73 74 | 72 61 69 67 68 74 0d 0a |airly st|raight..|
|00002590| 66 6f 72 77 61 72 64 2e | 20 20 54 68 65 20 76 69 |forward.| The vi|
|000025a0| 65 77 2d 70 6f 69 6e 74 | 20 61 6c 77 61 79 73 20 |ew-point| always |
|000025b0| 68 61 73 20 70 6f 73 69 | 74 69 6f 6e 20 56 45 43 |has posi|tion VEC|
|000025c0| 54 3d 7b 20 30 2c 20 30 | 2c 20 30 20 7d 3b 2e 20 |T={ 0, 0|, 0 };. |
|000025d0| 20 4f 74 68 65 72 0d 0a | 6f 62 6a 65 63 74 73 20 | Other..|objects |
|000025e0| 66 6f 6c 6c 6f 77 20 74 | 68 65 20 73 61 6d 65 20 |follow t|he same |
|000025f0| 73 6f 72 74 20 6f 66 20 | 73 79 73 74 65 6d 20 74 |sort of |system t|
|00002600| 68 61 74 20 74 68 65 79 | 20 77 6f 75 6c 64 20 69 |hat they| would i|
|00002610| 6e 20 41 62 73 6f 6c 75 | 74 65 20 43 6f 6f 72 2d |n Absolu|te Coor-|
|00002620| 0d 0a 64 69 6e 61 74 65 | 20 73 79 73 74 65 6d 73 |..dinate| systems|
|00002630| 2e 0d 0a 0d 0a 35 29 20 | 48 6f 77 20 64 6f 20 49 |.....5) |How do I|
|00002640| 20 64 65 66 69 6e 65 20 | 6f 72 69 65 6e 74 61 74 | define |orientat|
|00002650| 69 6f 6e 3f 0d 0a 0d 0a | 20 20 20 20 20 4f 72 69 |ion?....| Ori|
|00002660| 65 6e 74 61 74 69 6f 6e | 20 63 61 6e 20 62 65 20 |entation| can be |
|00002670| 71 75 69 74 65 20 74 72 | 69 63 6b 79 2e 20 20 49 |quite tr|icky. I|
|00002680| 20 69 6e 74 65 72 63 68 | 61 6e 67 65 20 73 6f 6d | interch|ange som|
|00002690| 65 20 6f 66 20 74 68 65 | 20 74 65 72 6d 73 0d 0a |e of the| terms..|
|000026a0| 68 65 72 65 20 71 75 69 | 74 65 20 6f 66 74 65 6e |here qui|te often|
|000026b0| 2e 20 20 49 6e 20 33 2d | 73 70 61 63 65 2c 20 6f |. In 3-|space, o|
|000026c0| 72 69 65 6e 74 61 74 69 | 6f 6e 20 6d 75 73 74 20 |rientati|on must |
|000026d0| 62 65 20 64 65 66 69 6e | 65 64 20 62 65 20 74 77 |be defin|ed be tw|
|000026e0| 6f 2d 61 6e 64 2d 0d 0a | 61 2d 68 61 6c 66 20 61 |o-and-..|a-half a|
|000026f0| 6e 67 6c 65 73 2e 20 20 | 22 54 77 6f 20 61 6e 64 |ngles. |"Two and|
|00002700| 20 61 20 68 61 6c 66 3f | 22 20 79 6f 75 20 73 61 | a half?|" you sa|
|00002710| 79 2e 20 20 57 65 6c 6c | 2c 20 61 6c 6d 6f 73 74 |y. Well|, almost|
|00002720| 20 65 76 65 72 79 6f 6e | 65 20 75 73 65 73 0d 0a | everyon|e uses..|
|00002730| 74 68 72 65 65 20 62 65 | 63 61 75 73 65 20 74 77 |three be|cause tw|
|00002740| 6f 20 6a 75 73 74 20 69 | 73 6e 27 74 20 65 6e 6f |o just i|sn't eno|
|00002750| 75 67 68 2c 20 62 75 74 | 20 69 66 20 79 6f 75 20 |ugh, but| if you |
|00002760| 77 61 6e 74 20 74 6f 20 | 62 65 20 74 65 63 68 6e |want to |be techn|
|00002770| 69 63 61 6c 2c 0d 0a 6f | 6e 65 20 6f 66 20 74 68 |ical,..o|ne of th|
|00002780| 6f 73 65 20 61 6e 67 6c | 65 73 20 6f 6e 6c 79 20 |ose angl|es only |
|00002790| 68 61 73 20 74 6f 20 72 | 61 6e 67 65 20 66 72 6f |has to r|ange fro|
|000027a0| 6d 20 30 20 2d 20 31 38 | 30 20 64 65 67 72 65 65 |m 0 - 18|0 degree|
|000027b0| 73 20 28 30 20 2d 20 50 | 49 2f 32 0d 0a 72 61 64 |s (0 - P|I/2..rad|
|000027c0| 69 61 6e 73 29 2e 0d 0a | 0d 0a 20 20 20 20 20 42 |ians)...|.. B|
|000027d0| 75 74 2c 20 74 61 6b 69 | 6e 67 20 74 68 61 74 20 |ut, taki|ng that |
|000027e0| 66 6f 72 20 67 72 61 6e | 74 65 64 20 6e 6f 77 2e |for gran|ted now.|
|000027f0| 2e 2e 2e 20 79 6f 75 20 | 68 61 76 65 20 74 6f 20 |... you |have to |
|00002800| 70 69 63 6b 20 61 6e 20 | 6f 72 69 65 6e 74 61 2d |pick an |orienta-|
|00002810| 0d 0a 74 69 6f 6e 20 66 | 6f 72 20 79 6f 75 72 20 |..tion f|or your |
|00002820| 76 69 65 77 2e 20 20 49 | 20 70 65 72 73 6f 6e 61 |view. I| persona|
|00002830| 6c 6c 79 20 70 72 65 66 | 65 72 20 74 6f 20 68 61 |lly pref|er to ha|
|00002840| 76 65 20 74 68 65 20 58 | 2d 61 78 69 73 20 72 75 |ve the X|-axis ru|
|00002850| 6e 20 66 72 6f 6d 0d 0a | 6c 65 66 74 20 74 6f 20 |n from..|left to |
|00002860| 72 69 67 68 74 20 61 63 | 72 6f 73 73 20 74 68 65 |right ac|ross the|
|00002870| 20 63 65 6e 74 65 72 20 | 6f 66 20 6d 79 20 73 63 | center |of my sc|
|00002880| 72 65 65 6e 2e 20 20 49 | 20 61 6c 73 6f 20 6c 69 |reen. I| also li|
|00002890| 6b 65 20 74 6f 20 68 61 | 76 65 20 74 68 65 0d 0a |ke to ha|ve the..|
|000028a0| 59 2d 61 78 69 73 20 72 | 75 6e 20 66 72 6f 6d 20 |Y-axis r|un from |
|000028b0| 74 68 65 20 62 6f 74 74 | 6f 6d 20 6f 66 20 6d 79 |the bott|om of my|
|000028c0| 20 73 63 72 65 65 6e 3b | 20 61 6e 64 20 49 20 61 | screen;| and I a|
|000028d0| 6c 73 6f 20 6c 69 6b 65 | 20 74 6f 20 68 61 76 65 |lso like| to have|
|000028e0| 20 74 68 65 20 5a 2d 0d | 0a 61 78 69 73 20 72 75 | the Z-.|.axis ru|
|000028f0| 6e 6e 69 6e 67 20 66 72 | 6f 6d 20 6d 65 20 73 74 |nning fr|om me st|
|00002900| 72 61 69 67 68 74 20 69 | 6e 74 6f 20 6d 79 20 73 |raight i|nto my s|
|00002910| 63 72 65 65 6e 2e 20 20 | 57 69 74 68 20 73 6f 6d |creen. |With som|
|00002920| 65 20 74 77 65 61 6b 69 | 6e 67 20 6f 66 0d 0a 70 |e tweaki|ng of..p|
|00002930| 6c 75 73 20 61 6e 64 20 | 6d 69 6e 75 73 20 73 69 |lus and |minus si|
|00002940| 67 6e 73 20 61 6e 64 20 | 61 20 62 69 74 20 6f 66 |gns and |a bit of|
|00002950| 20 72 65 2d 6f 72 64 65 | 72 69 6e 67 2c 20 61 6c | re-orde|ring, al|
|00002960| 6c 20 6f 66 20 74 68 65 | 20 6d 61 74 68 20 68 65 |l of the| math he|
|00002970| 72 65 2d 69 6e 0d 0a 63 | 61 6e 20 62 65 20 6d 6f |re-in..c|an be mo|
|00002980| 64 69 66 69 65 64 20 74 | 6f 20 72 65 66 6c 65 63 |dified t|o reflec|
|00002990| 74 20 61 6e 79 20 6f 72 | 69 65 6e 74 61 74 69 6f |t any or|ientatio|
|000029a0| 6e 20 6f 66 20 74 68 65 | 20 63 6f 6f 72 64 69 6e |n of the| coordin|
|000029b0| 61 74 65 20 73 79 73 74 | 65 6d 2e 0d 0a 53 6f 6d |ate syst|em...Som|
|000029c0| 65 20 70 65 6f 70 6c 65 | 20 70 72 65 66 65 72 20 |e people| prefer |
|000029d0| 74 6f 20 68 61 76 65 20 | 74 68 65 20 59 2d 61 78 |to have |the Y-ax|
|000029e0| 69 73 20 68 65 61 64 69 | 6e 67 20 69 6e 74 6f 20 |is headi|ng into |
|000029f0| 74 68 65 20 73 63 72 65 | 65 6e 20 77 69 74 68 20 |the scre|en with |
|00002a00| 74 68 65 0d 0a 5a 2d 61 | 78 69 73 20 67 6f 69 6e |the..Z-a|xis goin|
|00002a10| 67 20 76 65 72 74 69 63 | 61 6c 6c 79 2e 20 20 49 |g vertic|ally. I|
|00002a20| 74 27 73 20 61 6c 6c 20 | 61 20 6d 61 74 74 65 72 |t's all |a matter|
|00002a30| 20 6f 66 20 68 6f 77 20 | 79 6f 75 20 77 61 6e 74 | of how |you want|
|00002a40| 20 74 6f 20 64 65 66 69 | 6e 65 0d 0a 73 74 75 66 | to defi|ne..stuf|
|00002a50| 66 2e 0d 0a 0d 0a 20 20 | 20 20 20 47 69 76 65 6e |f..... | Given|
|00002a60| 20 74 68 61 74 20 79 6f | 75 27 76 65 20 61 67 72 | that yo|u've agr|
|00002a70| 65 65 64 20 77 69 74 68 | 20 6d 65 20 74 68 61 74 |eed with| me that|
|00002a80| 20 5a 20 63 61 6e 20 67 | 6f 20 69 6e 74 6f 20 74 | Z can g|o into t|
|00002a90| 68 65 20 73 63 72 65 65 | 6e 2c 0d 0a 77 68 61 74 |he scree|n,..what|
|00002aa0| 20 33 2d 61 6e 67 6c 65 | 73 20 64 6f 20 79 6f 75 | 3-angle|s do you|
|00002ab0| 20 6e 65 65 64 3f 20 20 | 28 48 65 72 65 27 73 20 | need? |(Here's |
|00002ac0| 77 68 65 72 65 20 49 20 | 73 74 61 6e 64 20 74 68 |where I |stand th|
|00002ad0| 65 20 62 69 67 67 65 73 | 74 20 63 68 61 6e 63 65 |e bigges|t chance|
|00002ae0| 20 6f 66 0d 0a 6d 75 63 | 6b 69 6e 67 20 75 70 20 | of..muc|king up |
|00002af0| 74 68 65 20 74 65 72 6d | 73 2e 29 20 20 59 6f 75 |the term|s.) You|
|00002b00| 20 6e 65 65 64 20 72 6f | 6c 6c 2c 20 70 69 74 63 | need ro|ll, pitc|
|00002b10| 68 2c 20 61 6e 64 20 79 | 61 77 2e 20 20 28 49 20 |h, and y|aw. (I |
|00002b20| 6f 66 74 65 6e 20 6d 69 | 78 20 75 70 0d 0a 72 6f |often mi|x up..ro|
|00002b30| 6c 6c 20 61 6e 64 20 79 | 61 77 20 61 6e 64 20 73 |ll and y|aw and s|
|00002b40| 75 63 68 2e 2e 2e 20 73 | 6f 20 69 66 20 79 6f 75 |uch... s|o if you|
|00002b50| 20 63 61 6e 20 66 6f 6c | 6c 6f 77 20 61 6c 6f 6e | can fol|low alon|
|00002b60| 67 20 77 69 74 68 6f 75 | 74 20 67 65 74 74 69 6e |g withou|t gettin|
|00002b70| 67 0d 0a 6c 6f 63 6b 65 | 64 20 69 6e 74 6f 20 6d |g..locke|d into m|
|00002b80| 79 20 74 65 72 6d 69 6e | 6f 6c 6f 67 79 2c 20 66 |y termin|ology, f|
|00002b90| 75 74 75 72 65 20 46 41 | 51 27 73 20 77 69 6c 6c |uture FA|Q's will|
|00002ba0| 20 63 6f 72 72 65 63 74 | 20 69 74 2e 29 0d 0a 0d | correct| it.)...|
|00002bb0| 0a 20 20 20 20 20 4c 6f | 6f 6b 20 61 74 20 79 6f |. Lo|ok at yo|
|00002bc0| 75 72 20 6d 6f 6e 69 74 | 6f 72 20 61 73 20 79 6f |ur monit|or as yo|
|00002bd0| 75 27 72 65 20 72 65 61 | 64 69 6e 67 20 74 68 69 |u're rea|ding thi|
|00002be0| 73 2e 20 20 4e 6f 77 20 | 74 69 6c 74 20 79 6f 75 |s. Now |tilt you|
|00002bf0| 72 20 68 65 61 64 20 73 | 6f 0d 0a 74 68 61 74 20 |r head s|o..that |
|00002c00| 79 6f 75 72 20 72 69 67 | 68 74 20 65 61 72 20 69 |your rig|ht ear i|
|00002c10| 73 20 6f 6e 20 79 6f 75 | 72 20 72 69 67 68 74 20 |s on you|r right |
|00002c20| 73 68 6f 75 6c 64 65 72 | 2e 20 20 54 68 69 73 20 |shoulder|. This |
|00002c30| 63 68 61 6e 67 65 20 69 | 6e 20 6f 72 69 65 6e 74 |change i|n orient|
|00002c40| 61 2d 0d 0a 74 69 6f 6e | 20 69 73 20 72 6f 6c 6c |a-..tion| is roll|
|00002c50| 20 28 6f 72 20 79 61 77 | 2e 2e 2e 20 62 75 74 20 | (or yaw|... but |
|00002c60| 49 20 63 61 6c 6c 20 69 | 74 20 72 6f 6c 6c 29 2e |I call i|t roll).|
|00002c70| 0d 0a 0d 0a 20 20 20 20 | 20 4f 6b 2c 20 6e 6f 77 |.... | Ok, now|
|00002c80| 20 73 69 74 20 75 70 20 | 73 74 72 61 69 67 68 74 | sit up |straight|
|00002c90| 20 61 67 61 69 6e 2e 20 | 4e 6f 77 20 62 72 69 6e | again. |Now brin|
|00002ca0| 67 20 79 6f 75 72 20 63 | 68 69 6e 20 64 6f 77 6e |g your c|hin down|
|00002cb0| 20 74 6f 20 6d 65 65 74 | 0d 0a 79 6f 75 72 20 63 | to meet|..your c|
|00002cc0| 68 65 73 74 2e 20 20 28 | 48 6d 6d 6d 2e 2e 2e 20 |hest. (|Hmmm... |
|00002cd0| 4c 4f 4f 4b 20 42 41 43 | 4b 20 4e 4f 57 21 21 21 |LOOK BAC|K NOW!!!|
|00002ce0| 2c 20 77 68 65 77 2e 2e | 2e 20 67 6c 61 64 20 79 |, whew..|. glad y|
|00002cf0| 6f 75 20 68 65 61 72 64 | 20 6d 65 2e 29 0d 0a 54 |ou heard| me.)..T|
|00002d00| 68 61 74 20 6d 6f 74 69 | 6f 6e 20 77 61 73 20 70 |hat moti|on was p|
|00002d10| 69 74 63 68 2e 0d 0a 0d | 0a 20 20 20 20 20 4f 6b |itch....|. Ok|
|00002d20| 2c 20 6e 6f 77 20 6c 6f | 6f 6b 20 6f 76 65 72 20 |, now lo|ok over |
|00002d30| 79 6f 75 72 20 72 69 67 | 68 74 20 73 68 6f 75 6c |your rig|ht shoul|
|00002d40| 64 65 72 20 6b 65 65 70 | 69 6e 67 20 79 6f 75 72 |der keep|ing your|
|00002d50| 20 68 65 61 64 20 76 65 | 72 74 69 63 61 6c 20 74 | head ve|rtical t|
|00002d60| 6f 0d 0a 73 65 65 20 77 | 68 6f 27 73 20 62 65 68 |o..see w|ho's beh|
|00002d70| 69 6e 64 20 79 6f 75 2e | 20 20 28 4c 4f 4f 4b 20 |ind you.| (LOOK |
|00002d80| 42 41 43 4b 20 41 47 41 | 49 4e 21 21 2e 29 20 20 |BACK AGA|IN!!.) |
|00002d90| 4f 6b 2e 2e 2e 20 74 68 | 61 74 20 77 61 73 20 79 |Ok... th|at was y|
|00002da0| 61 77 20 28 6f 72 0d 0a | 72 6f 6c 6c 2c 20 62 75 |aw (or..|roll, bu|
|00002db0| 74 20 49 20 63 61 6c 6c | 20 69 74 20 79 61 77 29 |t I call| it yaw)|
|00002dc0| 2e 0d 0a 0d 0a 20 20 20 | 20 20 54 68 61 74 27 73 |..... | That's|
|00002dd0| 20 74 68 65 20 62 61 73 | 69 63 73 2e 20 20 4e 6f | the bas|ics. No|
|00002de0| 77 2c 20 77 68 61 74 20 | 64 6f 20 49 20 64 6f 20 |w, what |do I do |
|00002df0| 77 69 74 68 20 74 68 65 | 6d 3f 20 20 57 65 6c 6c |with the|m? Well|
|00002e00| 2c 20 68 65 72 65 27 73 | 0d 0a 77 68 65 72 65 20 |, here's|..where |
|00002e10| 61 20 6e 69 63 65 20 62 | 6f 6f 6b 20 6f 6e 20 4d |a nice b|ook on M|
|00002e20| 61 74 72 69 78 20 41 72 | 69 74 68 6d 65 74 69 63 |atrix Ar|ithmetic|
|00002e30| 20 77 69 6c 6c 20 68 65 | 6c 70 20 79 6f 75 20 6f | will he|lp you o|
|00002e40| 75 74 2e 20 20 59 6f 75 | 20 68 61 76 65 20 74 6f |ut. You| have to|
|00002e50| 0d 0a 75 73 65 20 74 68 | 65 73 65 20 74 68 72 65 |..use th|ese thre|
|00002e60| 65 20 61 6e 67 6c 65 73 | 20 74 6f 20 6d 61 6b 65 |e angles| to make|
|00002e70| 20 61 20 54 72 61 6e 73 | 66 6f 72 6d 61 74 69 6f | a Trans|formatio|
|00002e80| 6e 20 6d 61 74 72 69 78 | 2e 20 20 5b 53 65 65 20 |n matrix|. [See |
|00002e90| 74 68 65 20 73 65 63 2d | 0d 0a 74 69 6f 6e 20 6f |the sec-|..tion o|
|00002ea0| 6e 20 4d 61 74 72 69 78 | 20 4d 61 74 68 5d 2e 20 |n Matrix| Math]. |
|00002eb0| 20 48 65 72 65 20 69 73 | 20 61 20 74 79 70 69 63 | Here is| a typic|
|00002ec0| 61 6c 20 6d 65 74 68 6f | 64 20 6f 66 20 64 6f 69 |al metho|d of doi|
|00002ed0| 6e 67 20 74 68 65 73 65 | 20 74 72 61 6e 73 66 6f |ng these| transfo|
|00002ee0| 72 2d 0d 0a 6d 61 74 69 | 6f 6e 73 3a 20 5b 4e 6f |r-..mati|ons: [No|
|00002ef0| 74 65 2c 20 69 66 20 79 | 6f 75 20 64 6f 6e 27 74 |te, if y|ou don't|
|00002f00| 20 68 61 76 65 20 5a 20 | 67 6f 69 6e 67 20 69 6e | have Z |going in|
|00002f10| 74 6f 20 79 6f 75 72 20 | 73 63 72 65 65 6e 20 79 |to your |screen y|
|00002f20| 6f 75 27 6c 6c 20 68 61 | 76 65 0d 0a 74 6f 20 6d |ou'll ha|ve..to m|
|00002f30| 75 6e 67 65 20 74 68 65 | 73 65 20 63 6f 6e 73 69 |unge the|se consi|
|00002f40| 64 65 72 61 62 6c 79 5d | 2e 0d 0a 0d 0a 20 20 20 |derably]|..... |
|00002f50| 20 20 20 20 20 74 79 70 | 65 64 65 66 20 64 6f 75 | typ|edef dou|
|00002f60| 62 6c 65 20 6d 61 74 72 | 69 78 5b 34 5d 5b 34 5d |ble matr|ix[4][4]|
|00002f70| 3b 0d 0a 20 20 20 20 20 | 20 20 20 64 6f 75 62 6c |;.. | doubl|
|00002f80| 65 20 73 72 2c 73 70 2c | 73 79 2c 63 72 2c 63 70 |e sr,sp,|sy,cr,cp|
|00002f90| 2c 63 79 3b 0d 0a 20 20 | 20 20 20 20 20 20 6d 61 |,cy;.. | ma|
|00002fa0| 74 72 69 78 20 6d 72 2c | 20 6d 70 2c 20 6d 79 3b |trix mr,| mp, my;|
|00002fb0| 20 20 20 20 20 20 2f 2a | 20 69 6e 64 69 76 69 64 | /*| individ|
|00002fc0| 75 61 6c 20 74 72 61 6e | 73 66 6f 72 6d 61 74 69 |ual tran|sformati|
|00002fd0| 6f 6e 73 20 2a 2f 0d 0a | 20 20 20 20 20 20 20 20 |ons */..| |
|00002fe0| 6d 61 74 72 69 78 20 73 | 3b 20 20 20 20 20 20 20 |matrix s|; |
|00002ff0| 20 20 20 20 20 20 20 20 | 2f 2a 20 66 69 6e 61 6c | |/* final|
|00003000| 20 6d 61 74 72 69 78 20 | 2a 2f 0d 0a 0d 0a 20 20 | matrix |*/.... |
|00003010| 20 20 20 20 20 20 73 72 | 20 3d 20 73 69 6e 28 20 | sr| = sin( |
|00003020| 72 6f 6c 6c 20 29 3b 20 | 20 20 20 20 63 72 20 3d |roll ); | cr =|
|00003030| 20 63 6f 73 28 20 72 6f | 6c 6c 20 29 3b 0d 0a 20 | cos( ro|ll );.. |
|00003040| 20 20 20 20 20 20 20 73 | 70 20 3d 20 73 69 6e 28 | s|p = sin(|
|00003050| 20 70 69 74 63 68 20 29 | 3b 20 20 20 20 63 70 20 | pitch )|; cp |
|00003060| 3d 20 63 6f 73 28 20 70 | 69 74 63 68 20 29 3b 0d |= cos( p|itch );.|
|00003070| 0a 0d 0a 20 20 20 20 20 | 20 20 20 73 79 20 3d 20 |... | sy = |
|00003080| 73 69 6e 28 20 79 61 77 | 20 29 3b 20 20 20 20 20 |sin( yaw| ); |
|00003090| 20 63 79 20 3d 20 63 6f | 73 28 20 79 61 77 20 29 | cy = co|s( yaw )|
|000030a0| 3b 0d 0a 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |;.... | |
|000030b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000030c0| 20 20 20 20 20 2f 2a 20 | 63 6c 65 61 72 20 61 6c | /* |clear al|
|000030d0| 6c 20 6d 61 74 72 69 78 | 65 73 0d 0a 20 20 20 20 |l matrix|es.. |
|000030e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000030f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 2a 2a 20 5b | | ** [|
|00003100| 53 65 65 20 74 68 65 20 | 73 65 63 74 69 6f 6e 20 |See the |section |
|00003110| 6f 6e 20 4d 61 74 72 69 | 78 20 4d 61 74 68 5d 0d |on Matri|x Math].|
|00003120| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003130| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003140| 20 2a 2f 0d 0a 20 20 20 | 20 20 20 20 20 69 64 65 | */.. | ide|
|00003150| 6e 74 69 74 79 28 20 26 | 6d 72 20 29 3b 20 69 64 |ntity( &|mr ); id|
|00003160| 65 6e 74 69 74 79 28 20 | 26 6d 70 20 29 3b 20 69 |entity( |&mp ); i|
|00003170| 64 65 6e 74 69 74 79 28 | 20 26 6d 79 20 29 3b 0d |dentity(| &my );.|
|00003180| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003190| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000031a0| 20 2f 2a 20 70 72 65 70 | 61 72 65 20 72 6f 6c 6c | /* prep|are roll|
|000031b0| 20 6d 61 74 72 69 78 20 | 2a 2f 0d 0a 20 20 20 20 | matrix |*/.. |
|000031c0| 20 20 20 20 6d 72 5b 30 | 5d 5b 30 5d 20 3d 20 6d | mr[0|][0] = m|
|000031d0| 72 5b 31 5d 5b 31 5d 20 | 3d 20 63 72 3b 0d 0a 20 |r[1][1] |= cr;.. |
|000031e0| 20 20 20 20 20 20 20 6d | 72 5b 31 5d 5b 30 5d 20 | m|r[1][0] |
|000031f0| 3d 20 2d 20 28 6d 72 5b | 30 5d 5b 31 5d 20 3d 20 |= - (mr[|0][1] = |
|00003200| 73 72 29 3b 0d 0a 0d 0a | 20 20 20 20 20 20 20 20 |sr);....| |
|00003210| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003220| 20 20 20 20 20 20 20 20 | 2f 2a 20 70 72 65 70 61 | |/* prepa|
|00003230| 72 65 20 70 69 74 63 68 | 20 6d 61 74 72 69 78 20 |re pitch| matrix |
|00003240| 2a 2f 0d 0a 20 20 20 20 | 20 20 20 20 6d 70 5b 31 |*/.. | mp[1|
|00003250| 5d 5b 31 5d 20 3d 20 6d | 70 5b 32 5d 5b 32 5d 20 |][1] = m|p[2][2] |
|00003260| 3d 20 63 70 3b 0d 0a 20 | 20 20 20 20 20 20 20 6d |= cp;.. | m|
|00003270| 70 5b 31 5d 5b 32 5d 20 | 3d 20 2d 20 28 6d 70 5b |p[1][2] |= - (mp[|
|00003280| 32 5d 5b 31 5d 20 3d 20 | 73 70 29 3b 0d 0a 0d 0a |2][1] = |sp);....|
|00003290| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000032b0| 2f 2a 20 70 72 65 70 61 | 72 65 20 79 61 77 20 6d |/* prepa|re yaw m|
|000032c0| 61 74 72 69 78 20 2a 2f | 0d 0a 20 20 20 20 20 20 |atrix */|.. |
|000032d0| 20 20 6d 79 5b 30 5d 5b | 30 5d 20 3d 20 6d 79 5b | my[0][|0] = my[|
|000032e0| 32 5d 5b 32 5d 20 3d 20 | 63 79 3b 0d 0a 20 20 20 |2][2] = |cy;.. |
|000032f0| 20 20 20 20 20 6d 79 5b | 30 5d 5b 32 5d 20 3d 20 | my[|0][2] = |
|00003300| 2d 20 28 6d 79 5b 32 5d | 5b 30 5d 20 3d 20 73 79 |- (my[2]|[0] = sy|
|00003310| 29 3b 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 6d 75 |);.... | mu|
|00003320| 6c 74 69 70 6c 79 28 20 | 26 6d 72 2c 20 26 6d 79 |ltiply( |&mr, &my|
|00003330| 2c 20 26 73 20 29 3b 0d | 0a 20 20 20 20 20 20 20 |, &s );.|. |
|00003340| 20 6d 75 6c 74 69 70 6c | 79 28 20 26 73 2c 20 26 | multipl|y( &s, &|
|00003350| 6d 70 2c 20 26 73 20 29 | 3b 0d 0a 0d 0a 36 29 20 |mp, &s )|;....6) |
|00003360| 48 6f 77 20 64 6f 20 49 | 20 64 65 66 69 6e 65 20 |How do I| define |
|00003370| 61 20 76 65 6c 6f 63 69 | 74 79 3f 0d 0a 0d 0a 53 |a veloci|ty?....S|
|00003380| 74 69 63 6b 79 20 71 75 | 65 73 74 69 6f 6e 2e 20 |ticky qu|estion. |
|00003390| 20 49 27 6c 6c 20 67 65 | 74 20 74 6f 20 69 74 20 | I'll ge|t to it |
|000033a0| 69 6e 20 74 68 65 20 6e | 65 78 74 20 72 65 76 2e |in the n|ext rev.|
|000033b0| 0d 0a 0d 0a 37 29 20 44 | 72 61 77 69 6e 67 20 74 |....7) D|rawing t|
|000033c0| 68 72 65 65 2d 64 69 6d | 65 6e 73 69 6f 6e 61 6c |hree-dim|ensional|
|000033d0| 20 6f 62 6a 65 63 74 73 | 20 6f 6e 20 61 20 74 77 | objects| on a tw|
|000033e0| 6f 2d 64 69 6d 65 6e 73 | 69 6f 6e 61 6c 20 73 63 |o-dimens|ional sc|
|000033f0| 72 65 65 6e 2e 0d 0a 0d | 0a 20 20 20 20 20 46 72 |reen....|. Fr|
|00003400| 6f 6d 20 63 6f 6d 70 2e | 67 72 61 70 68 69 63 73 |om comp.|graphics|
|00003410| 20 46 41 51 3a 0d 0a 0d | 0a 20 20 20 20 20 22 54 | FAQ:...|. "T|
|00003420| 68 65 72 65 20 61 72 65 | 20 6d 61 6e 79 20 77 61 |here are| many wa|
|00003430| 79 73 20 74 6f 20 64 6f | 20 74 68 69 73 2e 20 20 |ys to do| this. |
|00003440| 53 6f 6d 65 20 61 70 70 | 72 6f 61 63 68 65 73 20 |Some app|roaches |
|00003450| 6d 61 70 20 74 68 65 0d | 0a 20 20 20 20 20 76 69 |map the.|. vi|
|00003460| 65 77 69 6e 67 20 72 65 | 63 74 61 6e 67 6c 65 20 |ewing re|ctangle |
|00003470| 6f 6e 74 6f 20 74 68 65 | 20 73 63 65 6e 65 2c 20 |onto the| scene, |
|00003480| 62 79 20 73 68 6f 6f 74 | 69 6e 67 20 72 61 79 73 |by shoot|ing rays|
|00003490| 20 74 68 72 6f 75 67 68 | 0d 0a 20 20 20 20 20 65 | through|.. e|
|000034a0| 61 63 68 20 70 69 78 65 | 6c 20 63 65 6e 74 65 72 |ach pixe|l center|
|000034b0| 20 61 6e 64 20 61 73 73 | 69 67 6e 69 6e 67 20 63 | and ass|igning c|
|000034c0| 6f 6c 6f 72 20 61 63 63 | 6f 72 64 69 6e 67 20 74 |olor acc|ording t|
|000034d0| 6f 20 74 68 65 20 6f 62 | 6a 65 63 74 0d 0a 20 20 |o the ob|ject.. |
|000034e0| 20 20 20 68 69 74 20 62 | 79 20 74 68 65 20 72 61 | hit b|y the ra|
|000034f0| 79 2e 20 20 4f 74 68 65 | 72 20 61 70 70 72 6f 61 |y. Othe|r approa|
|00003500| 63 68 65 73 20 6d 61 70 | 20 74 68 65 20 73 63 65 |ches map| the sce|
|00003510| 6e 65 20 6f 6e 74 6f 20 | 74 68 65 20 76 69 65 77 |ne onto |the view|
|00003520| 2d 0d 0a 20 20 20 20 20 | 69 6e 67 20 72 65 63 74 |-.. |ing rect|
|00003530| 61 6e 67 6c 65 2c 20 62 | 79 20 64 72 61 77 69 6e |angle, b|y drawin|
|00003540| 67 20 65 61 63 68 20 6f | 62 6a 65 63 74 20 69 6e |g each o|bject in|
|00003550| 74 6f 20 74 68 65 20 72 | 65 67 69 6f 6e 2c 20 6b |to the r|egion, k|
|00003560| 65 65 70 69 6e 67 0d 0a | 20 20 20 20 20 74 72 61 |eeping..| tra|
|00003570| 63 6b 20 6f 66 20 77 68 | 69 63 68 20 6f 62 6a 65 |ck of wh|ich obje|
|00003580| 63 74 20 69 73 20 69 6e | 20 66 72 6f 6e 74 20 6f |ct is in| front o|
|00003590| 66 20 77 68 69 63 68 2e | 0d 0a 0d 0a 20 20 20 20 |f which.|.... |
|000035a0| 20 54 68 65 20 6d 61 70 | 70 69 6e 67 20 6d 65 6e | The map|ping men|
|000035b0| 74 69 6f 6e 65 64 20 61 | 62 6f 76 65 20 69 73 20 |tioned a|bove is |
|000035c0| 61 6c 73 6f 20 72 65 66 | 65 72 72 65 64 20 74 6f |also ref|erred to|
|000035d0| 20 61 73 20 61 20 27 70 | 72 6f 6a 65 63 2d 0d 0a | as a 'p|rojec-..|
|000035e0| 20 20 20 20 20 74 69 6f | 6e 27 2c 20 61 6e 64 20 | tio|n', and |
|000035f0| 74 68 65 20 74 77 6f 20 | 6d 6f 73 74 20 70 6f 70 |the two |most pop|
|00003600| 75 6c 61 72 20 70 72 6f | 6a 65 63 74 69 6f 6e 73 |ular pro|jections|
|00003610| 20 61 72 65 20 70 65 72 | 73 70 65 63 74 69 76 65 | are per|spective|
|00003620| 0d 0a 20 20 20 20 20 70 | 72 6f 6a 65 63 74 69 6f |.. p|rojectio|
|00003630| 6e 20 61 6e 64 20 70 61 | 72 61 6c 6c 65 6c 20 70 |n and pa|rallel p|
|00003640| 72 6f 6a 65 63 74 69 6f | 6e 2e 20 20 46 6f 72 20 |rojectio|n. For |
|00003650| 65 78 61 6d 70 6c 65 2c | 20 74 6f 20 64 6f 20 61 |example,| to do a|
|00003660| 0d 0a 20 20 20 20 20 70 | 61 72 61 6c 6c 65 6c 20 |.. p|arallel |
|00003670| 70 72 6f 6a 65 63 74 69 | 6f 6e 20 6f 66 20 61 20 |projecti|on of a |
|00003680| 73 63 65 6e 65 20 6f 6e | 74 6f 20 61 20 76 69 65 |scene on|to a vie|
|00003690| 77 69 6e 67 20 72 65 63 | 74 61 6e 67 6c 65 2c 20 |wing rec|tangle, |
|000036a0| 79 6f 75 0d 0a 20 20 20 | 20 20 63 61 6e 20 6a 75 |you.. | can ju|
|000036b0| 73 74 20 64 69 73 63 61 | 72 64 20 74 68 65 20 5a |st disca|rd the Z|
|000036c0| 20 63 6f 6f 72 64 69 6e | 61 74 65 20 28 64 69 76 | coordin|ate (div|
|000036d0| 69 64 65 20 62 79 20 64 | 65 70 74 68 29 2c 20 61 |ide by d|epth), a|
|000036e0| 6e 64 0d 0a 20 20 20 20 | 20 27 63 6c 69 70 27 20 |nd.. | 'clip' |
|000036f0| 74 68 65 20 6f 62 6a 65 | 63 74 73 20 74 6f 20 74 |the obje|cts to t|
|00003700| 68 65 20 76 69 65 77 69 | 6e 67 20 72 65 63 74 61 |he viewi|ng recta|
|00003710| 6e 67 6c 65 20 28 64 69 | 73 63 61 72 64 20 70 6f |ngle (di|scard po|
|00003720| 72 74 69 6f 6e 73 0d 0a | 20 20 20 20 20 74 68 61 |rtions..| tha|
|00003730| 74 20 6c 69 65 20 6f 75 | 74 73 69 64 65 20 74 68 |t lie ou|tside th|
|00003740| 65 20 72 65 67 69 6f 6e | 29 2e 0d 0a 0d 0a 20 20 |e region|)..... |
|00003750| 20 20 20 46 6f 72 20 64 | 65 74 61 69 6c 73 20 6f | For d|etails o|
|00003760| 6e 20 33 44 20 72 65 6e | 64 65 72 69 6e 67 2c 20 |n 3D ren|dering, |
|00003770| 74 68 65 20 46 6f 6c 65 | 79 2c 20 76 61 6e 20 44 |the Fole|y, van D|
|00003780| 61 6d 2c 20 46 65 69 6e | 65 72 20 61 6e 64 0d 0a |am, Fein|er and..|
|00003790| 20 20 20 20 20 48 75 67 | 68 65 73 20 62 6f 6f 6b | Hug|hes book|
|000037a0| 2c 20 72 65 61 64 69 6e | 67 2e 20 20 43 68 61 70 |, readin|g. Chap|
|000037b0| 74 65 72 20 36 20 69 73 | 20 27 56 69 65 77 69 6e |ter 6 is| 'Viewin|
|000037c0| 67 20 69 6e 20 33 44 27 | 2c 20 61 6e 64 0d 0a 20 |g in 3D'|, and.. |
|000037d0| 20 20 20 20 63 68 61 70 | 74 65 72 20 31 35 20 69 | chap|ter 15 i|
|000037e0| 73 20 27 56 69 73 69 62 | 6c 65 2d 53 75 72 66 61 |s 'Visib|le-Surfa|
|000037f0| 63 65 20 44 65 74 65 72 | 6d 69 6e 61 74 69 6f 6e |ce Deter|mination|
|00003800| 27 2e 20 20 46 6f 72 20 | 6d 6f 72 65 0d 0a 20 20 |'. For |more.. |
|00003810| 20 20 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 67 | infor|mation g|
|00003820| 6f 20 74 6f 20 63 68 61 | 70 74 65 72 20 31 36 20 |o to cha|pter 16 |
|00003830| 66 6f 72 20 73 68 61 64 | 69 6e 67 2c 20 63 68 61 |for shad|ing, cha|
|00003840| 70 74 65 72 20 31 39 20 | 66 6f 72 20 63 6c 69 70 |pter 19 |for clip|
|00003850| 2d 0d 0a 20 20 20 20 20 | 70 69 6e 67 2c 20 61 6e |-.. |ping, an|
|00003860| 64 20 62 72 61 6e 63 68 | 20 6f 75 74 20 66 72 6f |d branch| out fro|
|00003870| 6d 20 74 68 65 72 65 2e | 22 0d 0a 0d 0a 38 29 20 |m there.|"....8) |
|00003880| 56 65 63 74 6f 72 20 4d | 61 74 68 20 2d 20 44 6f |Vector M|ath - Do|
|00003890| 74 20 50 72 6f 64 75 63 | 74 20 61 6e 64 20 43 72 |t Produc|t and Cr|
|000038a0| 6f 73 73 2d 50 72 6f 64 | 75 63 74 2e 0d 0a 0d 0a |oss-Prod|uct.....|
|000038b0| 20 20 20 20 20 41 64 64 | 69 6e 67 20 61 6e 64 20 | Add|ing and |
|000038c0| 73 75 62 74 72 61 63 74 | 69 6e 67 20 76 65 63 74 |subtract|ing vect|
|000038d0| 6f 72 73 20 69 73 20 61 | 73 20 65 61 73 79 20 61 |ors is a|s easy a|
|000038e0| 73 20 73 75 62 74 72 61 | 63 74 69 6e 67 20 74 68 |s subtra|cting th|
|000038f0| 65 69 72 0d 0a 72 65 73 | 70 65 63 74 69 76 65 20 |eir..res|pective |
|00003900| 70 61 72 74 73 3a 0d 0a | 0d 0a 20 20 20 20 20 20 |parts:..|.. |
|00003910| 20 20 3c 41 2c 42 2c 43 | 3e 20 2b 20 3c 44 2c 45 | <A,B,C|> + <D,E|
|00003920| 2c 46 3e 20 3d 20 3c 41 | 2b 44 2c 20 42 2b 45 2c |,F> = <A|+D, B+E,|
|00003930| 20 43 2b 46 3e 0d 0a 20 | 20 20 20 20 20 20 20 3c | C+F>.. | <|
|00003940| 41 2c 42 2c 43 3e 20 2d | 20 3c 44 2c 45 2c 46 3e |A,B,C> -| <D,E,F>|
|00003950| 20 3d 20 3c 41 2d 44 2c | 20 42 2d 45 2c 20 43 2d | = <A-D,| B-E, C-|
|00003960| 46 3e 0d 0a 0d 0a 20 20 | 20 20 20 53 63 61 6c 69 |F>.... | Scali|
|00003970| 6e 67 20 76 65 63 74 6f | 72 73 20 69 73 20 61 73 |ng vecto|rs is as|
|00003980| 20 73 69 6d 70 6c 65 20 | 61 73 20 6d 75 6c 74 69 | simple |as multi|
|00003990| 70 6c 79 69 6e 67 20 65 | 61 63 68 20 70 61 72 74 |plying e|ach part|
|000039a0| 20 62 79 20 61 20 63 6f | 6e 2d 0d 0a 73 74 61 6e | by a co|n-..stan|
|000039b0| 74 3a 0d 0a 0d 0a 20 20 | 20 20 20 20 20 20 53 20 |t:.... | S |
|000039c0| 2a 20 3c 41 2c 42 2c 43 | 3e 20 3d 20 3c 53 2a 41 |* <A,B,C|> = <S*A|
|000039d0| 2c 20 53 2a 42 2c 20 53 | 2a 43 3e 0d 0a 0d 0a 20 |, S*B, S|*C>.... |
|000039e0| 20 20 20 20 54 68 65 20 | 44 6f 74 2d 50 72 6f 64 | The |Dot-Prod|
|000039f0| 75 63 74 20 6f 66 20 74 | 77 6f 20 76 65 63 74 6f |uct of t|wo vecto|
|00003a00| 72 73 20 69 73 20 73 69 | 6d 70 6c 79 20 74 68 65 |rs is si|mply the|
|00003a10| 20 73 75 6d 20 6f 66 20 | 74 68 65 20 70 72 6f 64 | sum of |the prod|
|00003a20| 75 63 74 73 20 6f 66 0d | 0a 74 68 65 69 72 20 72 |ucts of.|.their r|
|00003a30| 65 73 70 65 63 74 69 76 | 65 20 70 61 72 74 73 3a |espectiv|e parts:|
|00003a40| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 20 3c 41 2c 42 |.... | <A,B|
|00003a50| 2c 43 3e 20 2e 20 3c 44 | 2c 45 2c 46 3e 20 3d 20 |,C> . <D|,E,F> = |
|00003a60| 41 2a 44 20 2b 20 42 2a | 45 20 2b 20 43 2a 46 0d |A*D + B*|E + C*F.|
|00003a70| 0a 0d 0a 4e 6f 74 65 20 | 74 68 61 74 20 74 68 69 |...Note |that thi|
|00003a80| 73 20 76 61 6c 75 65 20 | 69 73 20 6e 6f 74 20 61 |s value |is not a|
|00003a90| 20 76 65 63 74 6f 72 2e | 0d 0a 0d 0a 20 20 20 20 | vector.|.... |
|00003aa0| 20 54 68 65 20 43 72 6f | 73 73 2d 50 72 6f 64 75 | The Cro|ss-Produ|
|00003ab0| 63 74 20 6f 66 20 74 77 | 6f 20 76 65 63 74 6f 72 |ct of tw|o vector|
|00003ac0| 73 20 69 73 20 61 20 62 | 69 74 20 6d 6f 72 65 20 |s is a b|it more |
|00003ad0| 63 6f 6d 70 6c 65 78 20 | 28 69 74 20 69 73 20 74 |complex |(it is t|
|00003ae0| 68 65 0d 0a 64 65 74 65 | 72 6d 69 6e 61 6e 74 20 |he..dete|rminant |
|00003af0| 6f 66 20 74 68 65 20 6d | 61 74 72 69 78 20 77 69 |of the m|atrix wi|
|00003b00| 74 68 20 74 68 65 20 64 | 69 72 65 63 74 69 6f 6e |th the d|irection|
|00003b10| 20 76 65 63 74 6f 72 20 | 61 73 20 74 68 65 20 66 | vector |as the f|
|00003b20| 69 72 73 74 20 72 6f 77 | 2c 0d 0a 74 68 65 20 66 |irst row|,..the f|
|00003b30| 69 72 73 74 20 76 65 63 | 74 6f 72 20 61 73 20 74 |irst vec|tor as t|
|00003b40| 68 65 20 73 65 63 6f 6e | 64 20 72 6f 77 2c 20 61 |he secon|d row, a|
|00003b50| 6e 64 20 74 68 65 20 73 | 65 63 6f 6e 64 20 76 65 |nd the s|econd ve|
|00003b60| 63 74 6f 72 20 61 73 20 | 74 68 65 20 74 68 69 72 |ctor as |the thir|
|00003b70| 64 0d 0a 72 6f 77 29 3a | 0d 0a 0d 0a 20 20 20 20 |d..row):|.... |
|00003b80| 20 20 20 20 3c 41 2c 42 | 2c 43 3e 20 58 20 3c 44 | <A,B|,C> X <D|
|00003b90| 2c 45 2c 46 3e 20 3d 20 | 3c 42 2a 46 20 2d 20 43 |,E,F> = |<B*F - C|
|00003ba0| 2a 45 2c 20 43 2a 44 20 | 2d 20 41 2a 46 2c 20 41 |*E, C*D |- A*F, A|
|00003bb0| 2a 45 20 2d 20 42 2a 44 | 3e 0d 0a 0d 0a 4e 6f 74 |*E - B*D|>....Not|
|00003bc0| 65 20 74 68 61 74 3a 0d | 0a 0d 0a 3c 41 2c 42 2c |e that:.|...<A,B,|
|00003bd0| 43 3e 20 58 20 3c 44 2c | 45 2c 46 3e 20 3d 20 2d |C> X <D,|E,F> = -|
|00003be0| 31 20 2a 20 28 20 3c 44 | 2c 45 2c 46 3e 20 58 20 |1 * ( <D|,E,F> X |
|00003bf0| 3c 41 2c 42 2c 43 3e 20 | 29 0d 0a 20 20 20 20 20 |<A,B,C> |).. |
|00003c00| 20 20 20 2d 61 6e 64 2d | 0d 0a 28 3c 41 2c 42 2c | -and-|..(<A,B,|
|00003c10| 43 3e 20 58 20 3c 44 2c | 45 2c 46 3e 29 20 2e 20 |C> X <D,|E,F>) . |
|00003c20| 3c 41 2c 42 2c 43 3e 20 | 3d 20 28 3c 41 2c 42 2c |<A,B,C> |= (<A,B,|
|00003c30| 43 3e 20 58 20 3c 44 2c | 45 2c 46 3e 29 20 2e 20 |C> X <D,|E,F>) . |
|00003c40| 3c 44 2c 45 2c 46 3e 20 | 3d 20 30 0d 0a 0d 0a 20 |<D,E,F> |= 0.... |
|00003c50| 20 20 20 20 4d 6f 72 65 | 20 6c 61 74 65 72 2e 0d | More| later..|
|00003c60| 0a 0d 0a 39 29 20 4d 61 | 74 72 69 78 20 4d 61 74 |...9) Ma|trix Mat|
|00003c70| 68 0d 0a 0d 0a 20 20 20 | 20 20 54 68 65 20 69 64 |h.... | The id|
|00003c80| 65 6e 74 69 74 79 20 6d | 61 74 72 69 78 20 69 73 |entity m|atrix is|
|00003c90| 20 74 68 65 20 6f 6e 65 | 20 77 69 74 68 20 61 6c | the one| with al|
|00003ca0| 6c 20 65 6c 65 6d 65 6e | 74 73 20 7b 69 2c 6a 7d |l elemen|ts {i,j}|
|00003cb0| 20 67 69 76 65 6e 20 62 | 79 3a 0d 0a 0d 0a 20 20 | given b|y:.... |
|00003cc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003cd0| 7b 20 31 2e 30 20 20 20 | 69 66 20 69 20 3d 3d 20 |{ 1.0 |if i == |
|00003ce0| 6a 0d 0a 20 20 20 20 20 | 20 20 20 6d 5b 69 5d 5b |j.. | m[i][|
|00003cf0| 6a 5d 20 3d 20 7b 0d 0a | 20 20 20 20 20 20 20 20 |j] = {..| |
|00003d00| 20 20 20 20 20 20 20 20 | 20 20 7b 20 30 2e 30 20 | | { 0.0 |
|00003d10| 20 20 6f 74 68 65 72 77 | 69 73 65 0d 0a 0d 0a 20 | otherw|ise.... |
|00003d20| 20 20 20 20 53 6f 72 72 | 79 2e 2e 2e 20 77 61 6e | Sorr|y... wan|
|00003d30| 74 65 64 20 74 6f 20 67 | 65 74 20 61 74 20 6c 65 |ted to g|et at le|
|00003d40| 61 73 74 20 61 20 70 61 | 72 74 69 61 6c 20 46 41 |ast a pa|rtial FA|
|00003d50| 51 20 6f 75 74 20 73 6f | 6f 6e 2c 20 73 6f 20 74 |Q out so|on, so t|
|00003d60| 68 69 73 0d 0a 73 65 63 | 74 69 6f 6e 20 69 73 20 |his..sec|tion is |
|00003d70| 6d 6f 73 74 6c 79 20 62 | 6c 61 6e 6b 20 66 6f 72 |mostly b|lank for|
|00003d80| 20 6e 6f 77 2e 20 20 57 | 69 6c 6c 20 64 6f 20 6d | now. W|ill do m|
|00003d90| 6f 72 65 20 6c 61 74 65 | 72 2e 0d 0a 0d 0a 31 30 |ore late|r.....10|
|00003da0| 29 20 43 6f 6c 6c 69 73 | 69 6f 6e 73 2e 0d 0a 0d |) Collis|ions....|
|00003db0| 0a 20 20 20 20 20 53 6f | 72 72 79 2e 2e 2e 20 77 |. So|rry... w|
|00003dc0| 61 6e 74 65 64 20 74 6f | 20 67 65 74 20 61 74 20 |anted to| get at |
|00003dd0| 6c 65 61 73 74 20 61 20 | 70 61 72 74 69 61 6c 20 |least a |partial |
|00003de0| 46 41 51 20 6f 75 74 20 | 73 6f 6f 6e 2c 20 73 6f |FAQ out |soon, so|
|00003df0| 20 74 68 69 73 0d 0a 73 | 65 63 74 69 6f 6e 20 69 | this..s|ection i|
|00003e00| 73 20 6d 6f 73 74 6c 79 | 20 62 6c 61 6e 6b 20 66 |s mostly| blank f|
|00003e10| 6f 72 20 6e 6f 77 2e 20 | 20 57 69 6c 6c 20 64 6f |or now. | Will do|
|00003e20| 20 6d 6f 72 65 20 6c 61 | 74 65 72 2e 0d 0a 0d 0a | more la|ter.....|
|00003e30| 31 31 29 20 50 65 72 73 | 70 65 63 74 69 76 65 2e |11) Pers|pective.|
|00003e40| 0d 0a 0d 0a 20 20 20 20 | 20 53 6f 72 72 79 2e 2e |.... | Sorry..|
|00003e50| 2e 20 77 61 6e 74 65 64 | 20 74 6f 20 67 65 74 20 |. wanted| to get |
|00003e60| 61 74 20 6c 65 61 73 74 | 20 61 20 70 61 72 74 69 |at least| a parti|
|00003e70| 61 6c 20 46 41 51 20 6f | 75 74 20 73 6f 6f 6e 2c |al FAQ o|ut soon,|
|00003e80| 20 73 6f 20 74 68 69 73 | 0d 0a 73 65 63 74 69 6f | so this|..sectio|
|00003e90| 6e 20 69 73 20 6d 6f 73 | 74 6c 79 20 62 6c 61 6e |n is mos|tly blan|
|00003ea0| 6b 20 66 6f 72 20 6e 6f | 77 2e 20 20 57 69 6c 6c |k for no|w. Will|
|00003eb0| 20 64 6f 20 6d 6f 72 65 | 20 6c 61 74 65 72 2e 0d | do more| later..|
|00003ec0| 0a 0d 0a 31 32 29 20 5a | 2d 42 75 66 66 65 72 69 |...12) Z|-Bufferi|
|00003ed0| 6e 67 20 26 20 74 68 65 | 20 50 61 69 6e 74 65 72 |ng & the| Painter|
|00003ee0| 73 20 41 6c 67 6f 72 69 | 74 68 6d 2e 0d 0a 0d 0a |s Algori|thm.....|
|00003ef0| 20 20 20 20 20 53 6f 72 | 72 79 2e 2e 2e 20 77 61 | Sor|ry... wa|
|00003f00| 6e 74 65 64 20 74 6f 20 | 67 65 74 20 61 74 20 6c |nted to |get at l|
|00003f10| 65 61 73 74 20 61 20 70 | 61 72 74 69 61 6c 20 46 |east a p|artial F|
|00003f20| 41 51 20 6f 75 74 20 73 | 6f 6f 6e 2c 20 73 6f 20 |AQ out s|oon, so |
|00003f30| 74 68 69 73 0d 0a 73 65 | 63 74 69 6f 6e 20 69 73 |this..se|ction is|
|00003f40| 20 6d 6f 73 74 6c 79 20 | 62 6c 61 6e 6b 20 66 6f | mostly |blank fo|
|00003f50| 72 20 6e 6f 77 2e 20 20 | 57 69 6c 6c 20 64 6f 20 |r now. |Will do |
|00003f60| 6d 6f 72 65 20 6c 61 74 | 65 72 2e 0d 0a 0d 0a 31 |more lat|er.....1|
|00003f70| 33 29 20 53 68 61 64 69 | 6e 67 2e 0d 0a 0d 0a 20 |3) Shadi|ng..... |
|00003f80| 20 20 20 20 53 6f 72 72 | 79 2e 2e 2e 20 77 61 6e | Sorr|y... wan|
|00003f90| 74 65 64 20 74 6f 20 67 | 65 74 20 61 74 20 6c 65 |ted to g|et at le|
|00003fa0| 61 73 74 20 61 20 70 61 | 72 74 69 61 6c 20 46 41 |ast a pa|rtial FA|
|00003fb0| 51 20 6f 75 74 20 73 6f | 6f 6e 2c 20 73 6f 20 74 |Q out so|on, so t|
|00003fc0| 68 69 73 0d 0a 73 65 63 | 74 69 6f 6e 20 69 73 20 |his..sec|tion is |
|00003fd0| 6d 6f 73 74 6c 79 20 62 | 6c 61 6e 6b 20 66 6f 72 |mostly b|lank for|
|00003fe0| 20 6e 6f 77 2e 20 20 57 | 69 6c 6c 20 64 6f 20 6d | now. W|ill do m|
|00003ff0| 6f 72 65 20 6c 61 74 65 | 72 2e 0d 0a 0d 0a 31 34 |ore late|r.....14|
|00004000| 29 20 33 2d 73 70 61 63 | 65 20 63 6c 69 70 70 69 |) 3-spac|e clippi|
|00004010| 6e 67 2e 0d 0a 0d 0a 20 | 20 20 20 20 53 6f 72 72 |ng..... | Sorr|
|00004020| 79 2e 2e 2e 20 77 61 6e | 74 65 64 20 74 6f 20 67 |y... wan|ted to g|
|00004030| 65 74 20 61 74 20 6c 65 | 61 73 74 20 61 20 70 61 |et at le|ast a pa|
|00004040| 72 74 69 61 6c 20 46 41 | 51 20 6f 75 74 20 73 6f |rtial FA|Q out so|
|00004050| 6f 6e 2c 20 73 6f 20 74 | 68 69 73 0d 0a 73 65 63 |on, so t|his..sec|
|00004060| 74 69 6f 6e 20 69 73 20 | 6d 6f 73 74 6c 79 20 62 |tion is |mostly b|
|00004070| 6c 61 6e 6b 20 66 6f 72 | 20 6e 6f 77 2e 20 20 57 |lank for| now. W|
|00004080| 69 6c 6c 20 64 6f 20 6d | 6f 72 65 20 6c 61 74 65 |ill do m|ore late|
|00004090| 72 2e 0d 0a 0d 0a 31 35 | 29 20 33 2d 64 20 73 63 |r.....15|) 3-d sc|
|000040a0| 61 6e 6e 69 6e 67 2e 0d | 0a 0d 0a 20 20 20 20 20 |anning..|... |
|000040b0| 53 6f 72 72 79 2e 2e 2e | 20 77 61 6e 74 65 64 20 |Sorry...| wanted |
|000040c0| 74 6f 20 67 65 74 20 61 | 74 20 6c 65 61 73 74 20 |to get a|t least |
|000040d0| 61 20 70 61 72 74 69 61 | 6c 20 46 41 51 20 6f 75 |a partia|l FAQ ou|
|000040e0| 74 20 73 6f 6f 6e 2c 20 | 73 6f 20 74 68 69 73 0d |t soon, |so this.|
|000040f0| 0a 73 65 63 74 69 6f 6e | 20 69 73 20 6d 6f 73 74 |.section| is most|
|00004100| 6c 79 20 62 6c 61 6e 6b | 20 66 6f 72 20 6e 6f 77 |ly blank| for now|
|00004110| 2e 20 20 57 69 6c 6c 20 | 64 6f 20 6d 6f 72 65 20 |. Will |do more |
|00004120| 6c 61 74 65 72 2e 0d 0a | 0d 0a 31 36 29 20 50 75 |later...|..16) Pu|
|00004130| 62 6c 69 63 61 6c 6c 79 | 20 61 76 61 69 6c 61 62 |blically| availab|
|00004140| 6c 65 20 73 6f 75 72 63 | 65 2d 63 6f 64 65 2e 0d |le sourc|e-code..|
|00004150| 0a 0d 0a 20 20 20 20 20 | 53 6f 72 72 79 2e 2e 2e |... |Sorry...|
|00004160| 20 77 61 6e 74 65 64 20 | 74 6f 20 67 65 74 20 61 | wanted |to get a|
|00004170| 74 20 6c 65 61 73 74 20 | 61 20 70 61 72 74 69 61 |t least |a partia|
|00004180| 6c 20 46 41 51 20 6f 75 | 74 20 73 6f 6f 6e 2c 20 |l FAQ ou|t soon, |
|00004190| 73 6f 20 74 68 69 73 0d | 0a 73 65 63 74 69 6f 6e |so this.|.section|
|000041a0| 20 69 73 20 6d 6f 73 74 | 6c 79 20 62 6c 61 6e 6b | is most|ly blank|
|000041b0| 20 66 6f 72 20 6e 6f 77 | 2e 20 20 57 69 6c 6c 20 | for now|. Will |
|000041c0| 64 6f 20 6d 6f 72 65 20 | 6c 61 74 65 72 2e 0d 0a |do more |later...|
|000041d0| 0d 0a 31 37 29 20 42 6f | 6f 6b 73 20 6f 6e 20 74 |..17) Bo|oks on t|
|000041e0| 68 65 20 74 6f 70 69 63 | 73 2e 0d 0a 0d 0a 20 20 |he topic|s..... |
|000041f0| 20 20 20 53 6f 72 72 79 | 2e 2e 2e 20 77 61 6e 74 | Sorry|... want|
|00004200| 65 64 20 74 6f 20 67 65 | 74 20 61 74 20 6c 65 61 |ed to ge|t at lea|
|00004210| 73 74 20 61 20 70 61 72 | 74 69 61 6c 20 46 41 51 |st a par|tial FAQ|
|00004220| 20 6f 75 74 20 73 6f 6f | 6e 2c 20 73 6f 20 74 68 | out soo|n, so th|
|00004230| 69 73 0d 0a 73 65 63 74 | 69 6f 6e 20 69 73 20 6d |is..sect|ion is m|
|00004240| 6f 73 74 6c 79 20 62 6c | 61 6e 6b 20 66 6f 72 20 |ostly bl|ank for |
|00004250| 6e 6f 77 2e 20 20 57 69 | 6c 6c 20 64 6f 20 6d 6f |now. Wi|ll do mo|
|00004260| 72 65 20 6c 61 74 65 72 | 2e 0d 0a 0d 0a 31 38 29 |re later|.....18)|
|00004270| 20 4f 74 68 65 72 20 66 | 6f 72 75 6d 73 2e 0d 0a | Other f|orums...|
|00004280| 0d 0a 20 20 20 20 20 53 | 6f 72 72 79 2e 2e 2e 20 |.. S|orry... |
|00004290| 77 61 6e 74 65 64 20 74 | 6f 20 67 65 74 20 61 74 |wanted t|o get at|
|000042a0| 20 6c 65 61 73 74 20 61 | 20 70 61 72 74 69 61 6c | least a| partial|
|000042b0| 20 46 41 51 20 6f 75 74 | 20 73 6f 6f 6e 2c 20 73 | FAQ out| soon, s|
|000042c0| 6f 20 74 68 69 73 0d 0a | 73 65 63 74 69 6f 6e 20 |o this..|section |
|000042d0| 69 73 20 6d 6f 73 74 6c | 79 20 62 6c 61 6e 6b 20 |is mostl|y blank |
|000042e0| 66 6f 72 20 6e 6f 77 2e | 20 20 57 69 6c 6c 20 64 |for now.| Will d|
|000042f0| 6f 20 6d 6f 72 65 20 6c | 61 74 65 72 2e 0d 0a 0d |o more l|ater....|
|00004300| 0a 2d 2d 20 0d 0a 20 20 | 20 20 6d 75 0d 0a 0d 0a |.-- .. | mu....|
|00004310| 0d 0a 00 | |... | |
+--------+-------------------------+-------------------------+--------+--------+